Diff
Modified: trunk/Source/WTF/ChangeLog (154293 => 154294)
--- trunk/Source/WTF/ChangeLog 2013-08-19 20:33:57 UTC (rev 154293)
+++ trunk/Source/WTF/ChangeLog 2013-08-19 20:38:33 UTC (rev 154294)
@@ -1,3 +1,48 @@
+2013-08-19 Joseph Pecoraro <[email protected]>
+
+ <https://webkit.org/b/119905> [iOS] Upstream Source/WTF
+
+ Reviewed by Benjamin Poulain.
+
+ Upstream iOS WebKit Source/WTF.
+
+ * Configurations/Base.xcconfig:
+ _javascript_Core.framework is a public framework.
+
+ * wtf/Assertions.h:
+ Define an export macro for iOS projects just including <wtf/Assertions.h>.
+
+ * wtf/Platform.h:
+ * wtf/FeatureDefines.h:
+ iOS ENABLE and USE defines.
+
+ * wtf/MainThread.h:
+ * wtf/mac/MainThreadMac.mm:
+ (WTF::initializeApplicationUIThreadIdentifier):
+ (WTF::initializeWebThreadIdentifier):
+ (WTF::canAccessThreadLocalDataForThread):
+ * wtf/WeakPtr.h:
+ (WTF::WeakReference::get):
+ (WTF::WeakReference::clear):
+ Shared WebThread and MainThread access to thread local data.
+
+ * wtf/WTFThreadData.cpp:
+ (WTF::WTFThreadData::WTFThreadData):
+ Shared WebThread and MainThread identifier tables.
+
+ * wtf/ThreadSpecific.h:
+ (WTF::::replace):
+ Used later on so that WebThread can share the MainThread's thread global data.
+
+ * wtf/text/StringStatics.cpp:
+ (WTF::AtomicString::init):
+ When USE(WEB_THREAD) assert AtomicString::init is initialized on the realMainThread.
+
+ * wtf/unicode/CharacterNames.h:
+ * wtf/unicode/icu/UnicodeIcu.h:
+ (WTF::Unicode::hasLineBreakingPropertyComplexContextOrIdeographic):
+ Minor iOS constants and functions used later by WebCore.
+
2013-08-16 Arunprasad Rajkumar <[email protected]>
<https://webkit.org/b/119785> Replace currentTime() with monotonicallyIncreasingTime() in WebCore
Modified: trunk/Source/WTF/Configurations/Base.xcconfig (154293 => 154294)
--- trunk/Source/WTF/Configurations/Base.xcconfig 2013-08-19 20:33:57 UTC (rev 154293)
+++ trunk/Source/WTF/Configurations/Base.xcconfig 2013-08-19 20:38:33 UTC (rev 154294)
@@ -71,10 +71,7 @@
SUPPORTED_PLATFORMS = iphoneos iphonesimulator macosx;
-_javascript_CORE_FRAMEWORKS_DIR = $(_javascript_CORE_FRAMEWORKS_DIR_$(PLATFORM_NAME));
-_javascript_CORE_FRAMEWORKS_DIR_iphoneos = $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
-_javascript_CORE_FRAMEWORKS_DIR_iphonesimulator = $(_javascript_CORE_FRAMEWORKS_DIR_iphoneos);
-_javascript_CORE_FRAMEWORKS_DIR_macosx = $(SYSTEM_LIBRARY_DIR)/Frameworks;
+_javascript_CORE_FRAMEWORKS_DIR = $(SYSTEM_LIBRARY_DIR)/Frameworks;
// DEBUG_DEFINES, GCC_OPTIMIZATION_LEVEL, STRIP_INSTALLED_PRODUCT and DEAD_CODE_STRIPPING vary between the debug and normal variants.
// We set up the values for each variant here, and have the Debug configuration in the Xcode project use the _debug variant.
Modified: trunk/Source/WTF/wtf/Assertions.h (154293 => 154294)
--- trunk/Source/WTF/wtf/Assertions.h 2013-08-19 20:33:57 UTC (rev 154293)
+++ trunk/Source/WTF/wtf/Assertions.h 2013-08-19 20:38:33 UTC (rev 154294)
@@ -91,9 +91,16 @@
#if COMPILER(GCC) && !defined(__OBJC__)
#define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments) __attribute__((__format__(printf, formatStringArgument, extraArguments)))
#else
-#define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments)
+#define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments)
#endif
+#if PLATFORM(IOS)
+/* For a project that uses WTF but has no config.h, we need to explicitly set the export defines here. */
+#ifndef WTF_EXPORT_PRIVATE
+#define WTF_EXPORT_PRIVATE
+#endif
+#endif // PLATFORM(IOS)
+
/* These helper functions are always declared, but not necessarily always defined if the corresponding function is disabled. */
#ifdef __cplusplus
Modified: trunk/Source/WTF/wtf/FeatureDefines.h (154293 => 154294)
--- trunk/Source/WTF/wtf/FeatureDefines.h 2013-08-19 20:33:57 UTC (rev 154293)
+++ trunk/Source/WTF/wtf/FeatureDefines.h 2013-08-19 20:38:33 UTC (rev 154294)
@@ -68,6 +68,10 @@
#define ENABLE_CSS_IMAGE_SET 1
#endif
+#if !defined(ENABLE_DISK_IMAGE_CACHE)
+#define ENABLE_DISK_IMAGE_CACHE 1
+#endif
+
#if !defined(ENABLE_DRAG_SUPPORT)
#define ENABLE_DRAG_SUPPORT 0
#endif
@@ -80,6 +84,14 @@
#define ENABLE_ICONDATABASE 0
#endif
+#if !defined(ENABLE_IOS_GESTURE_EVENTS)
+#define ENABLE_IOS_GESTURE_EVENTS 1
+#endif
+
+#if !defined(ENABLE_LETTERPRESS)
+#define ENABLE_LETTERPRESS 1
+#endif
+
#if !defined(ENABLE_METER_ELEMENT)
#define ENABLE_METER_ELEMENT 0
#endif
@@ -89,17 +101,29 @@
#endif
#if !defined(ENABLE_ORIENTATION_EVENTS)
-#define ENABLE_ORIENTATION_EVENTS 1
+#define ENABLE_ORIENTATION_EVENTS 1
#endif
+#if !defined(ENABLE_POINTER_LOCK)
+#define ENABLE_POINTER_LOCK 0
+#endif
+
#if !defined(ENABLE_REPAINT_THROTTLING)
-#define ENABLE_REPAINT_THROTTLING 1
+#define ENABLE_REPAINT_THROTTLING 0
#endif
+#if !defined(ENABLE_RESPECT_EXIF_ORIENTATION)
+#define ENABLE_RESPECT_EXIF_ORIENTATION 1
+#endif
+
#if !defined(ENABLE_TEXT_CARET)
#define ENABLE_TEXT_CARET 0
#endif
+#if !defined(ENABLE_TOUCH_EVENTS)
+#define ENABLE_TOUCH_EVENTS 1
+#endif
+
#if !defined(ENABLE_WEB_ARCHIVE)
#define ENABLE_WEB_ARCHIVE 1
#endif
Modified: trunk/Source/WTF/wtf/MainThread.h (154293 => 154294)
--- trunk/Source/WTF/wtf/MainThread.h 2013-08-19 20:33:57 UTC (rev 154293)
+++ trunk/Source/WTF/wtf/MainThread.h 2013-08-19 20:38:33 UTC (rev 154294)
@@ -54,6 +54,9 @@
#if USE(WEB_THREAD)
WTF_EXPORT_PRIVATE bool isWebThread();
WTF_EXPORT_PRIVATE bool isUIThread();
+WTF_EXPORT_PRIVATE void initializeApplicationUIThreadIdentifier();
+WTF_EXPORT_PRIVATE void initializeWebThreadIdentifier();
+WTF_EXPORT_PRIVATE bool canAccessThreadLocalDataForThread(ThreadIdentifier);
#else
inline bool isWebThread() { return isMainThread(); }
inline bool isUIThread() { return isMainThread(); }
@@ -64,7 +67,7 @@
#if ENABLE(PARALLEL_GC)
void registerGCThread();
WTF_EXPORT_PRIVATE bool isMainThreadOrGCThread();
-#elif PLATFORM(MAC)
+#elif PLATFORM(MAC) || PLATFORM(IOS)
WTF_EXPORT_PRIVATE bool isMainThreadOrGCThread();
#else
inline bool isMainThreadOrGCThread() { return isMainThread(); }
@@ -93,4 +96,10 @@
using WTF::setMainThreadCallbacksPaused;
using WTF::isMainThread;
using WTF::isMainThreadOrGCThread;
+#if USE(WEB_THREAD)
+using WTF::initializeApplicationUIThreadIdentifier;
+using WTF::initializeWebThreadIdentifier;
+using WTF::canAccessThreadLocalDataForThread;
+#endif
+
#endif // MainThread_h
Modified: trunk/Source/WTF/wtf/Platform.h (154293 => 154294)
--- trunk/Source/WTF/wtf/Platform.h 2013-08-19 20:33:57 UTC (rev 154293)
+++ trunk/Source/WTF/wtf/Platform.h 2013-08-19 20:38:33 UTC (rev 154294)
@@ -1006,7 +1006,7 @@
#define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1
#endif
-#if (PLATFORM(MAC) || (OS(WINDOWS) && USE(CG))) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000) || ((PLATFORM(MAC) || (OS(WINDOWS) && USE(CG))) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090)
#define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1
#endif
@@ -1022,7 +1022,7 @@
#define HAVE_INVERTED_WHEEL_EVENTS 1
#endif
-#if PLATFORM(MAC)
+#if PLATFORM(MAC) && !PLATFORM(IOS)
#define WTF_USE_COREAUDIO 1
#endif
@@ -1037,27 +1037,33 @@
#endif
#endif
-#if !PLATFORM(IOS) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
+#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080)
#define WTF_USE_CONTENT_FILTERING 1
#endif
#define WTF_USE_GRAMMAR_CHECKING 1
-#if PLATFORM(MAC) || PLATFORM(BLACKBERRY) || PLATFORM(EFL)
+#if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(BLACKBERRY) || PLATFORM(EFL)
#define WTF_USE_UNIFIED_TEXT_CHECKING 1
#endif
-#if PLATFORM(MAC)
+#if !PLATFORM(IOS) && PLATFORM(MAC)
#define WTF_USE_AUTOMATIC_TEXT_REPLACEMENT 1
#endif
-#if PLATFORM(MAC) && (PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)
+#if !PLATFORM(IOS) && (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)
/* Some platforms provide UI for suggesting autocorrection. */
#define WTF_USE_AUTOCORRECTION_PANEL 1
+#endif
+#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)
/* Some platforms use spelling and autocorrection markers to provide visual cue. On such platform, if word with marker is edited, we need to remove the marker. */
#define WTF_USE_MARKER_REMOVAL_UPON_EDITING 1
-#endif /* #if PLATFORM(MAC) && (PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) */
+#endif
+#if PLATFORM(IOS)
+#define WTF_USE_PLATFORM_TEXT_TRACK_MENU 1
+#endif
+
#if PLATFORM(MAC) || PLATFORM(IOS)
#define WTF_USE_AUDIO_SESSION 1
#endif
Modified: trunk/Source/WTF/wtf/ThreadSpecific.h (154293 => 154294)
--- trunk/Source/WTF/wtf/ThreadSpecific.h 2013-08-19 20:33:57 UTC (rev 154293)
+++ trunk/Source/WTF/wtf/ThreadSpecific.h 2013-08-19 20:38:33 UTC (rev 154294)
@@ -68,6 +68,10 @@
operator T*();
T& operator*();
+#if USE(WEB_THREAD)
+ void replace(T*);
+#endif
+
private:
#if OS(WINDOWS)
friend void ThreadSpecificThreadExit();
@@ -273,6 +277,19 @@
return *operator T*();
}
+#if USE(WEB_THREAD)
+template<typename T>
+inline void ThreadSpecific<T>::replace(T* newPtr)
+{
+ ASSERT(newPtr);
+ Data* data = ""
+ ASSERT(data);
+ data->value->~T();
+ fastFree(data->value);
+ data->value = newPtr;
+}
+#endif
+
} // namespace WTF
#endif // WTF_ThreadSpecific_h
Modified: trunk/Source/WTF/wtf/WTFThreadData.cpp (154293 => 154294)
--- trunk/Source/WTF/wtf/WTFThreadData.cpp 2013-08-19 20:33:57 UTC (rev 154293)
+++ trunk/Source/WTF/wtf/WTFThreadData.cpp 2013-08-19 20:38:33 UTC (rev 154294)
@@ -29,6 +29,10 @@
#include <wtf/text/AtomicStringTable.h>
+#if USE(WEB_THREAD)
+#include <wtf/MainThread.h>
+#endif
+
namespace WTF {
ThreadSpecific<WTFThreadData>* WTFThreadData::staticData;
@@ -37,13 +41,24 @@
: m_apiData(0)
, m_atomicStringTable(0)
, m_atomicStringTableDestructor(0)
+#if !USE(WEB_THREAD)
, m_defaultIdentifierTable(new JSC::IdentifierTable())
, m_currentIdentifierTable(m_defaultIdentifierTable)
+#endif
, m_stackBounds(StackBounds::currentThreadStackBounds())
#if ENABLE(STACK_STATS)
, m_stackStats()
#endif
{
+#if USE(WEB_THREAD)
+ static JSC::IdentifierTable* sharedIdentifierTable = new JSC::IdentifierTable();
+ if (pthread_main_np() || isWebThread())
+ m_defaultIdentifierTable = sharedIdentifierTable;
+ else
+ m_defaultIdentifierTable = new JSC::IdentifierTable();
+
+ m_currentIdentifierTable = m_defaultIdentifierTable;
+#endif
AtomicStringTable::create(*this);
}
Modified: trunk/Source/WTF/wtf/WeakPtr.h (154293 => 154294)
--- trunk/Source/WTF/wtf/WeakPtr.h 2013-08-19 20:33:57 UTC (rev 154293)
+++ trunk/Source/WTF/wtf/WeakPtr.h 2013-08-19 20:38:33 UTC (rev 154294)
@@ -32,6 +32,10 @@
#include <wtf/ThreadSafeRefCounted.h>
#include <wtf/Threading.h>
+#if USE(WEB_THREAD)
+#include <wtf/MainThread.h>
+#endif
+
namespace WTF {
template<typename T>
@@ -44,13 +48,21 @@
T* get() const
{
+#if USE(WEB_THREAD)
+ ASSERT(canAccessThreadLocalDataForThread(m_boundThread));
+#else
ASSERT(m_boundThread == currentThread());
+#endif
return m_ptr;
}
void clear()
{
+#if USE(WEB_THREAD)
+ ASSERT(canAccessThreadLocalDataForThread(m_boundThread));
+#else
ASSERT(m_boundThread == currentThread());
+#endif
m_ptr = 0;
}
Modified: trunk/Source/WTF/wtf/mac/MainThreadMac.mm (154293 => 154294)
--- trunk/Source/WTF/wtf/mac/MainThreadMac.mm 2013-08-19 20:33:57 UTC (rev 154293)
+++ trunk/Source/WTF/wtf/mac/MainThreadMac.mm 2013-08-19 20:38:33 UTC (rev 154294)
@@ -62,6 +62,11 @@
static pthread_t mainThreadPthread;
static NSThread* mainThreadNSThread;
+#if USE(WEB_THREAD)
+static ThreadIdentifier sApplicationUIThreadIdentifier;
+static ThreadIdentifier sWebThreadIdentifier;
+#endif
+
void initializeMainThreadPlatform()
{
ASSERT(!staticMainThreadCaller);
@@ -144,6 +149,30 @@
{
return pthread_equal(pthread_self(), mainThreadPthread);
}
+
+void initializeApplicationUIThreadIdentifier()
+{
+ ASSERT(pthread_main_np());
+ sApplicationUIThreadIdentifier = currentThread();
+}
+
+void initializeWebThreadIdentifier()
+{
+ ASSERT(!pthread_main_np());
+ sWebThreadIdentifier = currentThread();
+}
+
+bool canAccessThreadLocalDataForThread(ThreadIdentifier threadId)
+{
+ ThreadIdentifier currentThreadId = currentThread();
+ if (threadId == currentThreadId)
+ return true;
+
+ if (threadId == sWebThreadIdentifier || threadId == sApplicationUIThreadIdentifier)
+ return (currentThreadId == sWebThreadIdentifier || currentThreadId == sApplicationUIThreadIdentifier) && WebCoreWebThreadIsLockedOrDisabled();
+
+ return false;
+}
#else
bool isMainThread()
{
Modified: trunk/Source/WTF/wtf/text/StringStatics.cpp (154293 => 154294)
--- trunk/Source/WTF/wtf/text/StringStatics.cpp 2013-08-19 20:33:57 UTC (rev 154293)
+++ trunk/Source/WTF/wtf/text/StringStatics.cpp 2013-08-19 20:38:33 UTC (rev 154294)
@@ -35,6 +35,10 @@
#include "StaticConstructors.h"
#include "StringImpl.h"
+#if USE(WEB_THREAD)
+#include <pthread.h>
+#endif
+
namespace WTF {
StringImpl* StringImpl::empty()
@@ -75,7 +79,7 @@
static bool initialized;
if (!initialized) {
// Initialization is not thread safe, so this function must be called from the main thread first.
- ASSERT(isMainThread());
+ ASSERT(isUIThread());
// Use placement new to initialize the globals.
new (NotNull, (void*)&nullAtom) AtomicString;
Modified: trunk/Source/WTF/wtf/unicode/CharacterNames.h (154293 => 154294)
--- trunk/Source/WTF/wtf/unicode/CharacterNames.h 2013-08-19 20:33:57 UTC (rev 154293)
+++ trunk/Source/WTF/wtf/unicode/CharacterNames.h 2013-08-19 20:38:33 UTC (rev 154294)
@@ -20,7 +20,7 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CharacterNames_h
@@ -36,6 +36,7 @@
// Most of these are UChar constants, not UChar32, which makes them
// more convenient for WebCore code that mostly uses UTF-16.
+const UChar AppleLogo = 0xF8FF;
const UChar32 aegeanWordSeparatorLine = 0x10100;
const UChar32 aegeanWordSeparatorDot = 0x10101;
const UChar apostrophe = 0x0027;
@@ -94,6 +95,7 @@
} // namespace Unicode
} // namespace WTF
+using WTF::Unicode::AppleLogo;
using WTF::Unicode::aegeanWordSeparatorLine;
using WTF::Unicode::aegeanWordSeparatorDot;
using WTF::Unicode::blackCircle;
Modified: trunk/Source/WTF/wtf/unicode/icu/UnicodeIcu.h (154293 => 154294)
--- trunk/Source/WTF/wtf/unicode/icu/UnicodeIcu.h 2013-08-19 20:33:57 UTC (rev 154293)
+++ trunk/Source/WTF/wtf/unicode/icu/UnicodeIcu.h 2013-08-19 20:38:33 UTC (rev 154294)
@@ -193,6 +193,12 @@
return u_getIntPropertyValue(c, UCHAR_LINE_BREAK) == U_LB_COMPLEX_CONTEXT;
}
+inline bool hasLineBreakingPropertyComplexContextOrIdeographic(UChar32 c)
+{
+ int32_t prop = u_getIntPropertyValue(c, UCHAR_LINE_BREAK);
+ return prop == U_LB_COMPLEX_CONTEXT || prop == U_LB_IDEOGRAPHIC;
+}
+
inline UChar32 mirroredChar(UChar32 c)
{
return u_charMirror(c);