diff options
author | Andrei Popescu <andreip@google.com> | 2009-08-03 13:16:56 +0100 |
---|---|---|
committer | Andrei Popescu <andreip@google.com> | 2009-08-03 16:04:26 +0100 |
commit | 917149bb7d8c49bb401a6e3740a1046168397bc4 (patch) | |
tree | 4bc6104959261a36b6f44a51f6f131a94a7bb945 | |
parent | 51c0d4c6b1b74fff7336d81451ba7d2fc132e31c (diff) | |
download | external_webkit-917149bb7d8c49bb401a6e3740a1046168397bc4.zip external_webkit-917149bb7d8c49bb401a6e3740a1046168397bc4.tar.gz external_webkit-917149bb7d8c49bb401a6e3740a1046168397bc4.tar.bz2 |
Enable workers for V8
-rw-r--r-- | Android.v8.mk | 1 | ||||
-rw-r--r-- | V8Binding/V8Binding.derived.mk | 20 | ||||
-rw-r--r-- | WebCore/Android.v8.derived.mk | 2 | ||||
-rw-r--r-- | WebCore/Android.v8.mk | 13 | ||||
-rw-r--r-- | WebCore/config.h | 8 | ||||
-rw-r--r-- | WebKit/android/jni/WebSettings.cpp | 22 |
6 files changed, 52 insertions, 14 deletions
diff --git a/Android.v8.mk b/Android.v8.mk index 8539084..577a884 100644 --- a/Android.v8.mk +++ b/Android.v8.mk @@ -175,6 +175,7 @@ LOCAL_C_INCLUDES := \ $(base_intermediates)/WebCore/platform \ $(base_intermediates)/WebCore/plugins \ $(base_intermediates)/WebCore/storage \ + $(base_intermediates)/WebCore/workers \ $(base_intermediates)/WebCore/xml \ $(base_intermediates)/JavaScriptCore diff --git a/V8Binding/V8Binding.derived.mk b/V8Binding/V8Binding.derived.mk index 2c6d216..2bc0b46 100644 --- a/V8Binding/V8Binding.derived.mk +++ b/V8Binding/V8Binding.derived.mk @@ -158,7 +158,7 @@ js_binding_scripts := \ $(WEBCORE_PATH)/bindings/scripts/IDLStructure.pm \ $(LOCAL_PATH)/scripts/generate-bindings.pl -FEATURE_DEFINES := ANDROID_ORIENTATION_SUPPORT ENABLE_TOUCH_EVENTS=1 V8_BINDING ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 +FEATURE_DEFINES := ANDROID_ORIENTATION_SUPPORT ENABLE_TOUCH_EVENTS=1 V8_BINDING ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_WORKERS=1 ifeq ($(ENABLE_VIDEO), true) FEATURE_DEFINES += ENaBLE_VIDEO=1 @@ -370,7 +370,8 @@ GEN := \ $(intermediates)/page/V8Navigator.h \ $(intermediates)/page/V8PositionError.h \ $(intermediates)/page/V8Screen.h \ - $(intermediates)/page/V8WebKitPoint.h + $(intermediates)/page/V8WebKitPoint.h \ + $(intermediates)/page/V8WorkerNavigator.h $(GEN): PRIVATE_CUSTOM_TOOL = SOURCE_ROOT=$(WEBCORE_PATH) perl -I$(v8binding_dir)/scripts -I$(WEBCORE_PATH)/bindings/scripts $(v8binding_dir)/scripts/generate-bindings.pl --defines "$(FEATURE_DEFINES) LANGUAGE_JAVASCRIPT" --generator V8 --include dom --include html --outputdir $(dir $@) $< $(GEN): $(intermediates)/page/V8%.h : $(WEBCORE_PATH)/page/%.idl $(js_binding_scripts) $(transform-generated-source) @@ -426,6 +427,21 @@ LOCAL_GENERATED_SOURCES += $(GEN) $(GEN:%.h=%.cpp) # above rules. Specifying this explicitly makes -j2 work. $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/storage/%.cpp : $(intermediates)/storage/%.h +# Workers support +GEN := \ + $(intermediates)/workers/V8Worker.h \ + $(intermediates)/workers/V8WorkerContext.h \ + $(intermediates)/workers/V8WorkerLocation.h + +$(GEN): PRIVATE_CUSTOM_TOOL = SOURCE_ROOT=$(WEBCORE_PATH) perl -I$(v8binding_dir)/scripts -I$(WEBCORE_PATH)/bindings/scripts $(v8binding_dir)/scripts/generate-bindings.pl --defines "$(FEATURE_DEFINES) LANGUAGE_JAVASCRIPT" --generator V8 --include dom --include html --outputdir $(dir $@) $< +$(GEN): $(intermediates)/workers/V8%.h : $(WEBCORE_PATH)/workers/%.idl $(js_binding_scripts) + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) $(GEN:%.h=%.cpp) + +# We also need the .cpp files, which are generated as side effects of the +# above rules. Specifying this explicitly makes -j2 work. +$(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/workers/%.cpp : $(intermediates)/workers/%.h + #new section for svg ifeq ($(ENABLE_SVG), true) GEN := \ diff --git a/WebCore/Android.v8.derived.mk b/WebCore/Android.v8.derived.mk index a89ce31..115dc38 100644 --- a/WebCore/Android.v8.derived.mk +++ b/WebCore/Android.v8.derived.mk @@ -59,8 +59,6 @@ # If an entry starts with '/', any subdirectory may match # If an entry starts with '^', the first directory must match # LOCAL_DIR_WILDCARD_EXCLUDED := \ -# ^storage/* \ -# ^workers/* \ # This comment block is read by tools/webkitsync/diff.cpp # Don't remove it or move it. diff --git a/WebCore/Android.v8.mk b/WebCore/Android.v8.mk index 57f9406..74409e7 100644 --- a/WebCore/Android.v8.mk +++ b/WebCore/Android.v8.mk @@ -25,7 +25,6 @@ # accessibility/*.cpp \ # bridge/test*.cpp \ # css/CSSGrammar.y \ -# dom/Worker*.cpp \ # dom/XMLTokenizerQt.cpp \ # editing/BackForwardListChromium.cpp \ # editing/SmartReplace*.cpp \ @@ -36,13 +35,11 @@ # loader/CachedXSLStyleSheet.cpp \ # loader/FTP*.cpp \ # loader/UserStyleSheetLoader.cpp \ -# loader/WorkerThreadableLoader.cpp \ # loader/icon/IconDatabaseNone.cpp \ # page/AXObjectCache.cpp \ # page/Accessibility*.cpp \ # page/InspectorController.cpp \ # page/JavaScript*.cpp \ -# page/WorkerNavigator.cpp \ # platform/ThreadingNone.cpp \ # platform/graphics/FloatPoint3D.cpp \ # rendering/RenderThemeChromium*.cpp \ @@ -82,7 +79,6 @@ # /symbian/* \ # /v8/* \ # /win/* \ -# ^workers/* \ # ^wml/* \ # /wx/* \ @@ -411,6 +407,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ loader/DocLoader.cpp \ loader/DocumentLoader.cpp \ loader/DocumentThreadableLoader.cpp \ + loader/WorkerThreadableLoader.cpp \ loader/FormState.cpp \ loader/FrameLoader.cpp \ loader/ImageDocument.cpp \ @@ -471,6 +468,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ page/SecurityOrigin.cpp \ page/Settings.cpp \ page/WindowFeatures.cpp \ + page/WorkerNavigator.cpp \ \ page/android/DragControllerAndroid.cpp \ page/android/EventHandlerAndroid.cpp \ @@ -1008,6 +1006,13 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ endif LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ + workers/Worker.cpp \ + workers/WorkerContext.cpp \ + workers/WorkerImportScriptsClient.cpp \ + workers/WorkerLocation.cpp \ + workers/WorkerMessagingProxy.cpp \ + workers/WorkerRunLoop.cpp \ + workers/WorkerThread.cpp \ xml/DOMParser.cpp \ xml/XMLHttpRequest.cpp \ xml/XMLHttpRequestUpload.cpp \ diff --git a/WebCore/config.h b/WebCore/config.h index e7ab49f..24a4e6a 100644 --- a/WebCore/config.h +++ b/WebCore/config.h @@ -101,14 +101,10 @@ #define ENABLE_DOM_STORAGE 1 #undef ENABLE_FTPDIR #define ENABLE_FTPDIR 0 -#undef ENABLE_WORKERS -#if USE(V8) -// Workers do not work with V8 yet. -#else -#define ENABLE_WORKERS 1 -#endif // ENABLE_V8 #ifndef ENABLE_SVG #define ENABLE_SVG 0 +#undef ENABLE_WORKERS +#define ENABLE_WORKERS 1 #endif #if ENABLE_SVG #if !defined(ENABLE_SVG_ANIMATION) diff --git a/WebKit/android/jni/WebSettings.cpp b/WebKit/android/jni/WebSettings.cpp index 73ebf63..b6728fa 100644 --- a/WebKit/android/jni/WebSettings.cpp +++ b/WebKit/android/jni/WebSettings.cpp @@ -40,6 +40,9 @@ #include "Settings.h" #include "WebCoreFrameBridge.h" #include "WebCoreJni.h" +#if USE(V8) +#include "WorkerContextExecutionProxy.h" +#endif #include <JNIHelp.h> #include <utils/misc.h> @@ -94,6 +97,9 @@ struct FieldIds { mAppCachePath = env->GetFieldID(clazz, "mAppCachePath", "Ljava/lang/String;"); mAppCacheMaxSize = env->GetFieldID(clazz, "mAppCacheMaxSize", "J"); #endif +#if ENABLE(WORKERS) + mWorkersEnabled = env->GetFieldID(clazz, "mWorkersEnabled", "Z"); +#endif mJavaScriptCanOpenWindowsAutomatically = env->GetFieldID(clazz, "mJavaScriptCanOpenWindowsAutomatically", "Z"); mUseWideViewport = env->GetFieldID(clazz, "mUseWideViewport", "Z"); @@ -126,6 +132,9 @@ struct FieldIds { LOG_ASSERT(mAppCachePath, "Could not find field mAppCachePath"); LOG_ASSERT(mAppCacheMaxSize, "Could not find field mAppCacheMaxSize"); #endif +#if ENABLE(WORKERS) + LOG_ASSERT(mWorkersEnabled, "Could not find field mWorkersEnabled"); +#endif LOG_ASSERT(mJavaScriptCanOpenWindowsAutomatically, "Could not find field mJavaScriptCanOpenWindowsAutomatically"); LOG_ASSERT(mUseWideViewport, "Could not find field mUseWideViewport"); @@ -168,6 +177,9 @@ struct FieldIds { jfieldID mAppCachePath; jfieldID mAppCacheMaxSize; #endif +#if ENABLE(WORKERS) + jfieldID mWorkersEnabled; +#endif jfieldID mJavaScriptCanOpenWindowsAutomatically; jfieldID mUseWideViewport; jfieldID mSupportMultipleWindows; @@ -305,6 +317,16 @@ public: jlong maxsize = env->GetIntField(obj, gFieldIds->mAppCacheMaxSize); WebCore::cacheStorage().setMaximumSize(maxsize); #endif + +#if ENABLE(WORKERS) +#if USE(V8) + // This flag is only needed if we use V8. JSC doesn't yet have + // a setting for enabling workers. + flag = env->GetBooleanField(obj, gFieldIds->mWorkersEnabled); + WebCore::WorkerContextExecutionProxy::setIsWebWorkersEnabled(flag); +#endif +#endif + flag = env->GetBooleanField(obj, gFieldIds->mJavaScriptCanOpenWindowsAutomatically); s->setJavaScriptCanOpenWindowsAutomatically(flag); |