Diff
Modified: trunk/Source/WebCore/ChangeLog (126361 => 126362)
--- trunk/Source/WebCore/ChangeLog 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/ChangeLog 2012-08-22 22:44:33 UTC (rev 126362)
@@ -1,3 +1,47 @@
+2012-08-22 Kentaro Hara <[email protected]>
+
+ [V8] Remove V8Proxy from V8DOMWrapper::instantiateV8Object()
+ https://bugs.webkit.org/show_bug.cgi?id=94713
+
+ Reviewed by Adam Barth.
+
+ To kill V8Proxy, V8DOMWrapper::instantiateV8Object() should receive Frame*
+ instead of V8Proxy*.
+
+ No tests. No change in behavior.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateToV8Converters):
+ * bindings/scripts/test/V8/V8Float64Array.cpp:
+ (WebCore::V8Float64Array::wrapSlow):
+ * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
+ (WebCore::V8TestActiveDOMObject::wrapSlow):
+ * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
+ (WebCore::V8TestCustomNamedGetter::wrapSlow):
+ * bindings/scripts/test/V8/V8TestEventConstructor.cpp:
+ (WebCore::V8TestEventConstructor::wrapSlow):
+ * bindings/scripts/test/V8/V8TestEventTarget.cpp:
+ (WebCore::V8TestEventTarget::wrapSlow):
+ * bindings/scripts/test/V8/V8TestException.cpp:
+ (WebCore::V8TestException::wrapSlow):
+ * bindings/scripts/test/V8/V8TestInterface.cpp:
+ (WebCore::V8TestInterface::wrapSlow):
+ * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
+ (WebCore::V8TestMediaQueryListListener::wrapSlow):
+ * bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
+ (WebCore::V8TestNamedConstructor::wrapSlow):
+ * bindings/scripts/test/V8/V8TestNode.cpp:
+ (WebCore::V8TestNode::wrapSlow):
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::V8TestObj::wrapSlow):
+ * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
+ (WebCore::V8TestSerializedScriptValueInterface::wrapSlow):
+ * bindings/v8/V8DOMWrapper.cpp:
+ (WebCore):
+ (WebCore::V8DOMWrapper::instantiateV8Object):
+ * bindings/v8/V8DOMWrapper.h:
+ (V8DOMWrapper):
+
2012-08-22 Joshua Bell <[email protected]>
IndexedDB: IDBRequest can be destructed during abort
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (126361 => 126362)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-08-22 22:44:33 UTC (rev 126362)
@@ -3405,7 +3405,7 @@
}
push(@implContent, <<END);
- wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy ? proxy->frame() : 0, &info, impl.get());
END
if (IsNodeSubType($dataNode) || IsVisibleAcrossOrigins($dataNode)) {
push(@implContent, <<END);
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp (126361 => 126362)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp 2012-08-22 22:44:33 UTC (rev 126362)
@@ -152,7 +152,7 @@
v8::Handle<v8::Object> wrapper;
ASSERT(static_cast<void*>(static_cast<ArrayBufferView*>(impl.get())) == static_cast<void*>(impl.get()));
V8Proxy* proxy = 0;
- wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy ? proxy->frame() : 0, &info, impl.get());
if (UNLIKELY(wrapper.IsEmpty()))
return wrapper;
v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapper, isolate);
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp (126361 => 126362)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp 2012-08-22 22:44:33 UTC (rev 126362)
@@ -195,7 +195,7 @@
if (!context.IsEmpty())
context->Enter();
}
- wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy ? proxy->frame() : 0, &info, impl.get());
// Exit the node's context if it was entered.
if (!context.IsEmpty())
context->Exit();
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp (126361 => 126362)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp 2012-08-22 22:44:33 UTC (rev 126362)
@@ -114,7 +114,7 @@
{
v8::Handle<v8::Object> wrapper;
V8Proxy* proxy = 0;
- wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy ? proxy->frame() : 0, &info, impl.get());
if (UNLIKELY(wrapper.IsEmpty()))
return wrapper;
v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapper, isolate);
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp (126361 => 126362)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp 2012-08-22 22:44:33 UTC (rev 126362)
@@ -151,7 +151,7 @@
{
v8::Handle<v8::Object> wrapper;
V8Proxy* proxy = 0;
- wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy ? proxy->frame() : 0, &info, impl.get());
if (UNLIKELY(wrapper.IsEmpty()))
return wrapper;
v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapper, isolate);
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp (126361 => 126362)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp 2012-08-22 22:44:33 UTC (rev 126362)
@@ -175,7 +175,7 @@
{
v8::Handle<v8::Object> wrapper;
V8Proxy* proxy = 0;
- wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy ? proxy->frame() : 0, &info, impl.get());
if (UNLIKELY(wrapper.IsEmpty()))
return wrapper;
v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapper, isolate);
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp (126361 => 126362)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp 2012-08-22 22:44:33 UTC (rev 126362)
@@ -105,7 +105,7 @@
{
v8::Handle<v8::Object> wrapper;
V8Proxy* proxy = 0;
- wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy ? proxy->frame() : 0, &info, impl.get());
if (UNLIKELY(wrapper.IsEmpty()))
return wrapper;
v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapper, isolate);
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp (126361 => 126362)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp 2012-08-22 22:44:33 UTC (rev 126362)
@@ -348,7 +348,7 @@
{
v8::Handle<v8::Object> wrapper;
V8Proxy* proxy = 0;
- wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy ? proxy->frame() : 0, &info, impl.get());
if (UNLIKELY(wrapper.IsEmpty()))
return wrapper;
v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForActiveDOMObject(impl, wrapper, isolate);
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp (126361 => 126362)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp 2012-08-22 22:44:33 UTC (rev 126362)
@@ -114,7 +114,7 @@
{
v8::Handle<v8::Object> wrapper;
V8Proxy* proxy = 0;
- wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy ? proxy->frame() : 0, &info, impl.get());
if (UNLIKELY(wrapper.IsEmpty()))
return wrapper;
v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapper, isolate);
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp (126361 => 126362)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp 2012-08-22 22:44:33 UTC (rev 126362)
@@ -159,7 +159,7 @@
{
v8::Handle<v8::Object> wrapper;
V8Proxy* proxy = 0;
- wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy ? proxy->frame() : 0, &info, impl.get());
if (UNLIKELY(wrapper.IsEmpty()))
return wrapper;
v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForActiveDOMObject(impl, wrapper, isolate);
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp (126361 => 126362)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp 2012-08-22 22:44:33 UTC (rev 126362)
@@ -125,7 +125,7 @@
if (!context.IsEmpty())
context->Enter();
}
- wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy ? proxy->frame() : 0, &info, impl.get());
// Exit the node's context if it was entered.
if (!context.IsEmpty())
context->Exit();
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp (126361 => 126362)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp 2012-08-22 22:44:33 UTC (rev 126362)
@@ -2321,7 +2321,7 @@
{
v8::Handle<v8::Object> wrapper;
V8Proxy* proxy = 0;
- wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy ? proxy->frame() : 0, &info, impl.get());
if (UNLIKELY(wrapper.IsEmpty()))
return wrapper;
installPerContextProperties(wrapper, impl.get());
Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp (126361 => 126362)
--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp 2012-08-22 22:44:33 UTC (rev 126362)
@@ -297,7 +297,7 @@
{
v8::Handle<v8::Object> wrapper;
V8Proxy* proxy = 0;
- wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy ? proxy->frame() : 0, &info, impl.get());
if (UNLIKELY(wrapper.IsEmpty()))
return wrapper;
v8::Persistent<v8::Object> wrapperHandle = V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapper, isolate);
Modified: trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp (126361 => 126362)
--- trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp 2012-08-22 22:44:33 UTC (rev 126362)
@@ -110,12 +110,6 @@
}
#endif
-V8PerContextData* V8DOMWrapper::perContextData(V8Proxy* proxy)
-{
- V8DOMWindowShell* shell = proxy->windowShell();
- return shell ? shell->perContextData() : 0;
-}
-
#if ENABLE(WORKERS)
V8PerContextData* V8DOMWrapper::perContextData(WorkerContext*)
{
@@ -166,23 +160,19 @@
return NodeFilter::create(V8NodeFilterCondition::create(filter));
}
-v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(V8Proxy* proxy, WrapperTypeInfo* type, void* impl)
+v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(Frame* frame, WrapperTypeInfo* type, void* impl)
{
#if ENABLE(WORKERS)
WorkerContext* workerContext = 0;
#endif
- V8PerContextData* contextData = 0;
- V8IsolatedContext* isolatedContext;
- if (UNLIKELY(!!(isolatedContext = V8IsolatedContext::getEntered()))) {
- contextData = isolatedContext->perContextData();
- } else if (!proxy) {
+ if (!frame) {
v8::Handle<v8::Context> context = v8::Context::GetCurrent();
if (!context.IsEmpty()) {
v8::Handle<v8::Object> globalPrototype = v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype());
if (isWrapperOfType(globalPrototype, &V8DOMWindow::info)) {
- Frame* frame = V8DOMWindow::toNative(globalPrototype)->frame();
- if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript))
- proxy = frame->script()->proxy();
+ Frame* globalFrame = V8DOMWindow::toNative(globalPrototype)->frame();
+ if (globalFrame && globalFrame->script()->canExecuteScripts(NotAboutToExecuteScript))
+ frame = globalFrame;
}
#if ENABLE(WORKERS)
else if (isWrapperOfType(globalPrototype, &V8WorkerContext::info))
@@ -191,23 +181,21 @@
}
}
- v8::Local<v8::Object> instance;
- if (!contextData) {
- if (proxy)
- contextData = perContextData(proxy);
+ V8PerContextData* contextData = 0;
+ if (frame)
+ contextData = perContextDataForCurrentWorld(frame);
#if ENABLE(WORKERS)
- else if (workerContext)
- contextData = perContextData(workerContext);
+ else if (workerContext)
+ contextData = perContextData(workerContext);
#endif
- }
+ v8::Local<v8::Object> instance;
if (contextData)
instance = contextData->createWrapperFromCache(type);
else {
v8::Local<v8::Function> function = type->getTemplate()->GetFunction();
instance = V8ObjectConstructor::newInstance(function);
}
-
if (!instance.IsEmpty()) {
// Avoid setting the DOM wrapper for failed allocations.
setDOMWrapper(instance, type, impl);
Modified: trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h (126361 => 126362)
--- trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h 2012-08-22 22:28:56 UTC (rev 126361)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h 2012-08-22 22:44:33 UTC (rev 126362)
@@ -125,7 +125,7 @@
static void setNamedHiddenReference(v8::Handle<v8::Object> parent, const char* name, v8::Handle<v8::Value> child);
static void setNamedHiddenWindowReference(Frame*, const char*, v8::Handle<v8::Value>);
- static v8::Local<v8::Object> instantiateV8Object(V8Proxy* proxy, WrapperTypeInfo*, void* impl);
+ static v8::Local<v8::Object> instantiateV8Object(Frame*, WrapperTypeInfo*, void*);
static v8::Handle<v8::Object> getCachedWrapper(Node* node)
{
@@ -148,7 +148,6 @@
return domNodeMap.get(node);
}
private:
- static V8PerContextData* perContextData(V8Proxy*);
#if ENABLE(WORKERS)
static V8PerContextData* perContextData(WorkerContext*);
#endif