From: Steve Block Date: Wed, 17 Mar 2010 15:01:37 +0000 (+0000) Subject: Cherry-pick WebKit change 56112 to add WORKERS guards to V8 bindings X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c5e067fc0c6f7b1a0e1ed53743857cac5ff48a81;p=android-x86%2Fexternal-webkit.git 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 --- diff --git a/WebCore/bindings/v8/V8DOMWrapper.cpp b/WebCore/bindings/v8/V8DOMWrapper.cpp index d2ed659cc..0f96a74b7 100644 --- a/WebCore/bindings/v8/V8DOMWrapper.cpp +++ b/WebCore/bindings/v8/V8DOMWrapper.cpp @@ -212,6 +212,7 @@ v8::Local V8DOMWrapper::getConstructor(V8ClassIndex::V8WrapperType return getConstructorForContext(type, context); } +#if ENABLE(WORKERS) v8::Local V8DOMWrapper::getConstructor(V8ClassIndex::V8WrapperType type, WorkerContext*) { WorkerContextExecutionProxy* proxy = WorkerContextExecutionProxy::retrieve(); @@ -224,6 +225,7 @@ v8::Local V8DOMWrapper::getConstructor(V8ClassIndex::V8WrapperType return getConstructorForContext(type, context); } +#endif void V8DOMWrapper::setHiddenWindowReference(Frame* frame, const int internalIndex, v8::Handle jsObject) { @@ -296,8 +298,10 @@ v8::Local V8DOMWrapper::instantiateV8Object(V8Proxy* proxy, V8ClassI v8::Handle globalPrototype = v8::Handle::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 9b1fff5ef..85db55483 100644 --- a/WebCore/bindings/v8/V8Proxy.cpp +++ b/WebCore/bindings/v8/V8Proxy.cpp @@ -910,9 +910,11 @@ v8::Local 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(context)->script()->proxy()) return proxy->context(); +#endif } return v8::Local(); }