summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-03-17 15:01:37 +0000
committerSteve Block <steveblock@google.com>2010-03-17 15:39:51 +0000
commitc5e067fc0c6f7b1a0e1ed53743857cac5ff48a81 (patch)
tree23e286a3851d154e3b12cf4a5928e141a0035fa6 /WebCore/bindings
parentbb9e5d5b6918cc8d88601ed331b8203ac44c4647 (diff)
downloadexternal_webkit-c5e067fc0c6f7b1a0e1ed53743857cac5ff48a81.zip
external_webkit-c5e067fc0c6f7b1a0e1ed53743857cac5ff48a81.tar.gz
external_webkit-c5e067fc0c6f7b1a0e1ed53743857cac5ff48a81.tar.bz2
Cherry-pick WebKit change 56112 to add WORKERS guards to V8 bindings
The motivation for this change is to allow us to disable workers on Android, because V8 on Android does not have the required locking. See http://trac.webkit.org/changeset/56112 Change-Id: Ieee214f4765af3188bbdc51c56f14883f6a6779c
Diffstat (limited to 'WebCore/bindings')
-rw-r--r--WebCore/bindings/v8/V8DOMWrapper.cpp4
-rw-r--r--WebCore/bindings/v8/V8Proxy.cpp2
2 files changed, 6 insertions, 0 deletions
diff --git a/WebCore/bindings/v8/V8DOMWrapper.cpp b/WebCore/bindings/v8/V8DOMWrapper.cpp
index d2ed659..0f96a74 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -212,6 +212,7 @@ v8::Local<v8::Function> V8DOMWrapper::getConstructor(V8ClassIndex::V8WrapperType
return getConstructorForContext(type, context);
}
+#if ENABLE(WORKERS)
v8::Local<v8::Function> V8DOMWrapper::getConstructor(V8ClassIndex::V8WrapperType type, WorkerContext*)
{
WorkerContextExecutionProxy* proxy = WorkerContextExecutionProxy::retrieve();
@@ -224,6 +225,7 @@ v8::Local<v8::Function> V8DOMWrapper::getConstructor(V8ClassIndex::V8WrapperType
return getConstructorForContext(type, context);
}
+#endif
void V8DOMWrapper::setHiddenWindowReference(Frame* frame, const int internalIndex, v8::Handle<v8::Object> jsObject)
{
@@ -296,8 +298,10 @@ v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(V8Proxy* proxy, V8ClassI
v8::Handle<v8::Object> globalPrototype = v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype());
if (globalObjectPrototypeIsDOMWindow(globalPrototype))
proxy = V8Proxy::retrieve(V8DOMWindow::toNative(globalPrototype)->frame());
+#if ENABLE(WORKERS)
else
workerContext = V8WorkerContext::toNative(globalPrototype);
+#endif
}
}
diff --git a/WebCore/bindings/v8/V8Proxy.cpp b/WebCore/bindings/v8/V8Proxy.cpp
index 9b1fff5..85db554 100644
--- a/WebCore/bindings/v8/V8Proxy.cpp
+++ b/WebCore/bindings/v8/V8Proxy.cpp
@@ -910,9 +910,11 @@ v8::Local<v8::Context> toV8Context(ScriptExecutionContext* context, const WorldC
if (context->isDocument()) {
if (V8Proxy* proxy = V8Proxy::retrieve(context))
return worldContext.adjustedContext(proxy);
+#if ENABLE(WORKERS)
} else if (context->isWorkerContext()) {
if (WorkerContextExecutionProxy* proxy = static_cast<WorkerContext*>(context)->script()->proxy())
return proxy->context();
+#endif
}
return v8::Local<v8::Context>();
}