diff options
Diffstat (limited to 'webkit')
-rwxr-xr-x | webkit/build/V8Bindings/build-generated-files.sh | 2 | ||||
-rw-r--r-- | webkit/build/webkit_common_defines.vsprops | 2 | ||||
-rw-r--r-- | webkit/port/bindings/v8/V8WorkerCustom.cpp | 6 | ||||
-rw-r--r-- | webkit/port/bindings/v8/WorkerContextExecutionProxy.cpp | 10 | ||||
-rw-r--r-- | webkit/port/bindings/v8/WorkerContextExecutionProxy.h | 4 |
5 files changed, 22 insertions, 2 deletions
diff --git a/webkit/build/V8Bindings/build-generated-files.sh b/webkit/build/V8Bindings/build-generated-files.sh index f3e41f3..46a3dc0 100755 --- a/webkit/build/V8Bindings/build-generated-files.sh +++ b/webkit/build/V8Bindings/build-generated-files.sh @@ -43,7 +43,7 @@ export ENCODINGS_PREFIX="" # To see what FEATURE_DEFINES Apple uses, look at: # webkit/third_party/WebCore/Configurations/WebCore.xcconfig -export FEATURE_DEFINES="ENABLE_VIDEO ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_XPATH ENABLE_XSLT" +export FEATURE_DEFINES="ENABLE_WORKERS ENABLE_VIDEO ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_XPATH ENABLE_XSLT" # Adjust the number of jobs spawned according to the CPU count. if [ -z "$NUMBER_OF_PROCESSORS" ]; then diff --git a/webkit/build/webkit_common_defines.vsprops b/webkit/build/webkit_common_defines.vsprops index 0ea8266..e2ff37a5 100644 --- a/webkit/build/webkit_common_defines.vsprops +++ b/webkit/build/webkit_common_defines.vsprops @@ -6,6 +6,6 @@ > <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="ENABLE_DATABASE=1;ENABLE_DASHBOARD_SUPPORT=0;ENABLE_JAVASCRIPT_DEBUGGER=0;ENABLE_JSC_MULTIPLE_THREADS=0;ENABLE_ICONDATABASE=0;ENABLE_XSLT=1;ENABLE_XPATH=1;ENABLE_SVG=1;ENABLE_SVG_ANIMATION=1;ENABLE_SVG_AS_IMAGE=1;ENABLE_SVG_USE=1;ENABLE_SVG_FOREIGN_OBJECT=1;ENABLE_SVG_FONTS=1;ENABLE_VIDEO=1;ENABLE_WORKERS=0;WEBCORE_NAVIGATOR_PLATFORM="\"Win32\"";USE_GOOGLE_URL_LIBRARY;USE_SYSTEM_MALLOC=1;CRASH=__debugbreak;BUILDING_CHROMIUM__=1" + PreprocessorDefinitions="ENABLE_DATABASE=1;ENABLE_DASHBOARD_SUPPORT=0;ENABLE_JAVASCRIPT_DEBUGGER=0;ENABLE_JSC_MULTIPLE_THREADS=0;ENABLE_ICONDATABASE=0;ENABLE_XSLT=1;ENABLE_XPATH=1;ENABLE_SVG=1;ENABLE_SVG_ANIMATION=1;ENABLE_SVG_AS_IMAGE=1;ENABLE_SVG_USE=1;ENABLE_SVG_FOREIGN_OBJECT=1;ENABLE_SVG_FONTS=1;ENABLE_VIDEO=1;ENABLE_WORKERS=1;WEBCORE_NAVIGATOR_PLATFORM="\"Win32\"";USE_GOOGLE_URL_LIBRARY;USE_SYSTEM_MALLOC=1;CRASH=__debugbreak;BUILDING_CHROMIUM__=1" /> </VisualStudioPropertySheet> diff --git a/webkit/port/bindings/v8/V8WorkerCustom.cpp b/webkit/port/bindings/v8/V8WorkerCustom.cpp index 7426383..47be71c 100644 --- a/webkit/port/bindings/v8/V8WorkerCustom.cpp +++ b/webkit/port/bindings/v8/V8WorkerCustom.cpp @@ -34,6 +34,7 @@ #include "v8_binding.h" #include "v8_custom.h" #include "v8_proxy.h" +#include "WorkerContextExecutionProxy.h" #include "ExceptionCode.h" #include "Frame.h" @@ -48,6 +49,11 @@ namespace WebCore { CALLBACK_FUNC_DECL(WorkerConstructor) { INC_STATS(L"DOM.Worker.Constructor"); + if (!WorkerContextExecutionProxy::IsWebWorkersEnabled()) { + V8Proxy::ThrowError(V8Proxy::SYNTAX_ERROR, "Worker is not enabled."); + return v8::Undefined(); + } + if (!args.IsConstructCall()) { V8Proxy::ThrowError(V8Proxy::TYPE_ERROR, "DOM object constructor cannot be called as a function."); diff --git a/webkit/port/bindings/v8/WorkerContextExecutionProxy.cpp b/webkit/port/bindings/v8/WorkerContextExecutionProxy.cpp index b9ccf66..bfc4dec 100644 --- a/webkit/port/bindings/v8/WorkerContextExecutionProxy.cpp +++ b/webkit/port/bindings/v8/WorkerContextExecutionProxy.cpp @@ -45,6 +45,16 @@ namespace WebCore { +static bool g_worker_enabled = false; + +bool WorkerContextExecutionProxy::IsWebWorkersEnabled() { + return g_worker_enabled; +} + +void WorkerContextExecutionProxy::EnableWebWorkers(bool value) { + g_worker_enabled = true; +} + WorkerContextExecutionProxy::WorkerContextExecutionProxy( WorkerContext* workerContext) : m_workerContext(workerContext), diff --git a/webkit/port/bindings/v8/WorkerContextExecutionProxy.h b/webkit/port/bindings/v8/WorkerContextExecutionProxy.h index 2aaa160..9a5a0aa 100644 --- a/webkit/port/bindings/v8/WorkerContextExecutionProxy.h +++ b/webkit/port/bindings/v8/WorkerContextExecutionProxy.h @@ -88,6 +88,10 @@ class WorkerContextExecutionProxy { static v8::Handle<v8::Value> EventTargetToV8Object(EventTarget* target); static v8::Handle<v8::Value> WorkerContextToV8Object(WorkerContext* wc); + // Enables HTML5 worker support. + static void EnableWebWorkers(bool value); + static bool IsWebWorkersEnabled(); + private: void InitContextIfNeeded(); void Dispose(); |