Title: [140392] trunk/Source/WebCore
Revision
140392
Author
hara...@chromium.org
Date
2013-01-22 00:32:01 -0800 (Tue, 22 Jan 2013)

Log Message

[V8] Pass an Isolate to toV8()
https://bugs.webkit.org/show_bug.cgi?id=107512

Reviewed by Adam Barth.

By using Context::GetIsolate(), this patch passes an Isolate to toV8().

No tests. No change in behavior.

* bindings/v8/IDBBindingUtilities.cpp:
(WebCore::injectIDBKeyIntoScriptValue):
(WebCore::idbKeyToScriptValue):
* bindings/v8/ScriptController.cpp:
(WebCore::createScriptObject):
(WebCore::ScriptController::createScriptObjectForPluginElement):
* bindings/v8/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::currentCallFrame):
* bindings/v8/ScriptObject.cpp:
(WebCore::ScriptGlobalObject::set):
* bindings/v8/V8AbstractEventListener.cpp:
(WebCore::V8AbstractEventListener::handleEvent):
* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::V8DOMWindowShell::updateDocumentProperty):
* bindings/v8/V8MutationCallback.cpp:
(WebCore::V8MutationCallback::handleEvent):
* bindings/v8/V8NodeFilterCondition.cpp:
(WebCore::V8NodeFilterCondition::acceptNode):
* bindings/v8/V8WorkerContextEventListener.cpp:
(WebCore::V8WorkerContextEventListener::handleEvent):
* bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp:
(WebCore::V8SQLStatementErrorCallback::handleEvent):
* bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
(WebCore::InjectedScriptHost::nodeAsScriptValue):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (140391 => 140392)


--- trunk/Source/WebCore/ChangeLog	2013-01-22 08:13:08 UTC (rev 140391)
+++ trunk/Source/WebCore/ChangeLog	2013-01-22 08:32:01 UTC (rev 140392)
@@ -1,3 +1,39 @@
+2013-01-22  Kentaro Hara  <hara...@chromium.org>
+
+        [V8] Pass an Isolate to toV8()
+        https://bugs.webkit.org/show_bug.cgi?id=107512
+
+        Reviewed by Adam Barth.
+
+        By using Context::GetIsolate(), this patch passes an Isolate to toV8().
+
+        No tests. No change in behavior.
+
+        * bindings/v8/IDBBindingUtilities.cpp:
+        (WebCore::injectIDBKeyIntoScriptValue):
+        (WebCore::idbKeyToScriptValue):
+        * bindings/v8/ScriptController.cpp:
+        (WebCore::createScriptObject):
+        (WebCore::ScriptController::createScriptObjectForPluginElement):
+        * bindings/v8/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::currentCallFrame):
+        * bindings/v8/ScriptObject.cpp:
+        (WebCore::ScriptGlobalObject::set):
+        * bindings/v8/V8AbstractEventListener.cpp:
+        (WebCore::V8AbstractEventListener::handleEvent):
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::V8DOMWindowShell::updateDocumentProperty):
+        * bindings/v8/V8MutationCallback.cpp:
+        (WebCore::V8MutationCallback::handleEvent):
+        * bindings/v8/V8NodeFilterCondition.cpp:
+        (WebCore::V8NodeFilterCondition::acceptNode):
+        * bindings/v8/V8WorkerContextEventListener.cpp:
+        (WebCore::V8WorkerContextEventListener::handleEvent):
+        * bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp:
+        (WebCore::V8SQLStatementErrorCallback::handleEvent):
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::InjectedScriptHost::nodeAsScriptValue):
+
 2013-01-22  Sergey Ryazanov  <se...@chromium.org>
 
         Web Inspector: Show requests in `curl` syntax in DevTools → Network → Headers

Modified: trunk/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp (140391 => 140392)


--- trunk/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp	2013-01-22 08:13:08 UTC (rev 140391)
+++ trunk/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp	2013-01-22 08:32:01 UTC (rev 140392)
@@ -28,6 +28,7 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
+#include "DOMRequestState.h"
 #include "IDBKey.h"
 #include "IDBKeyPath.h"
 #include "IDBTracing.h"
@@ -221,7 +222,7 @@
     return ScriptValue(v8::Null());
 }
 
-bool injectIDBKeyIntoScriptValue(DOMRequestState*, PassRefPtr<IDBKey> key, ScriptValue& value, const IDBKeyPath& keyPath)
+bool injectIDBKeyIntoScriptValue(DOMRequestState* state, PassRefPtr<IDBKey> key, ScriptValue& value, const IDBKeyPath& keyPath)
 {
     IDB_TRACE("injectIDBKeyIntoScriptValue");
     ASSERT(v8::Context::InContext());
@@ -241,7 +242,7 @@
     if (parent.IsEmpty())
         return false;
 
-    if (!set(parent, keyPathElements.last(), toV8(key.get(), v8::Handle<v8::Object>())))
+    if (!set(parent, keyPathElements.last(), toV8(key.get(), v8::Handle<v8::Object>(), state->context()->GetIsolate())))
         return false;
 
     return true;
@@ -267,7 +268,7 @@
 {
     ASSERT(v8::Context::InContext());
     v8::HandleScope handleScope;
-    v8::Handle<v8::Value> v8Value(toV8(key.get(), v8::Handle<v8::Object>()));
+    v8::Handle<v8::Value> v8Value(toV8(key.get(), v8::Handle<v8::Object>(), state->context()->GetIsolate()));
     return ScriptValue(v8Value);
 }
 

Modified: trunk/Source/WebCore/bindings/v8/ScriptController.cpp (140391 => 140392)


--- trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2013-01-22 08:13:08 UTC (rev 140391)
+++ trunk/Source/WebCore/bindings/v8/ScriptController.cpp	2013-01-22 08:32:01 UTC (rev 140392)
@@ -616,7 +616,7 @@
 
     v8::Context::Scope scope(v8Context);
     DOMWindow* window = frame->document()->domWindow();
-    v8::Handle<v8::Value> global = toV8(window, v8::Handle<v8::Object>());
+    v8::Handle<v8::Value> global = toV8(window, v8::Handle<v8::Object>(), v8Context->GetIsolate());
     ASSERT(global->IsObject());
     return npCreateV8ScriptObject(0, v8::Handle<v8::Object>::Cast(global), window);
 }
@@ -656,7 +656,7 @@
     v8::Context::Scope scope(v8Context);
 
     DOMWindow* window = m_frame->document()->domWindow();
-    v8::Handle<v8::Value> v8plugin = toV8(static_cast<HTMLEmbedElement*>(plugin), v8::Handle<v8::Object>());
+    v8::Handle<v8::Value> v8plugin = toV8(static_cast<HTMLEmbedElement*>(plugin), v8::Handle<v8::Object>(), v8Context->GetIsolate());
     if (!v8plugin->IsObject())
         return createNoScriptObject();
 

Modified: trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp (140391 => 140392)


--- trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp	2013-01-22 08:13:08 UTC (rev 140391)
+++ trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp	2013-01-22 08:32:01 UTC (rev 140392)
@@ -385,7 +385,7 @@
 
     RefPtr<_javascript_CallFrame> currentCallFrame = _javascript_CallFrame::create(v8::Debug::GetDebugContext(), v8::Handle<v8::Object>::Cast(currentCallFrameV8));
     v8::Context::Scope contextScope(m_pausedContext);
-    return ScriptValue(toV8(currentCallFrame.release(), v8::Handle<v8::Object>()));
+    return ScriptValue(toV8(currentCallFrame.release(), v8::Handle<v8::Object>(), m_pausedContext->GetIsolate()));
 }
 
 void ScriptDebugServer::interruptAndRun(PassOwnPtr<Task> task, v8::Isolate* isolate)

Modified: trunk/Source/WebCore/bindings/v8/ScriptObject.cpp (140391 => 140392)


--- trunk/Source/WebCore/bindings/v8/ScriptObject.cpp	2013-01-22 08:13:08 UTC (rev 140391)
+++ trunk/Source/WebCore/bindings/v8/ScriptObject.cpp	2013-01-22 08:32:01 UTC (rev 140392)
@@ -73,14 +73,14 @@
 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorFrontendHost* value)
 {
     ScriptScope scope(scriptState);
-    scope.global()->Set(v8::String::NewSymbol(name), toV8(value, v8::Handle<v8::Object>()));
+    scope.global()->Set(v8::String::NewSymbol(name), toV8(value, v8::Handle<v8::Object>(), scriptState->isolate()));
     return scope.success();
 }
 
 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InjectedScriptHost* value)
 {
     ScriptScope scope(scriptState);
-    scope.global()->Set(v8::String::NewSymbol(name), toV8(value, v8::Handle<v8::Object>()));
+    scope.global()->Set(v8::String::NewSymbol(name), toV8(value, v8::Handle<v8::Object>(), scriptState->isolate()));
     return scope.success();
 }
 #endif

Modified: trunk/Source/WebCore/bindings/v8/V8AbstractEventListener.cpp (140391 => 140392)


--- trunk/Source/WebCore/bindings/v8/V8AbstractEventListener.cpp	2013-01-22 08:13:08 UTC (rev 140391)
+++ trunk/Source/WebCore/bindings/v8/V8AbstractEventListener.cpp	2013-01-22 08:32:01 UTC (rev 140392)
@@ -96,7 +96,7 @@
     v8::Context::Scope scope(v8Context);
 
     // Get the V8 wrapper for the event object.
-    v8::Handle<v8::Value> jsEvent = toV8(event, v8::Handle<v8::Object>());
+    v8::Handle<v8::Value> jsEvent = toV8(event, v8::Handle<v8::Object>(), v8Context->GetIsolate());
     ASSERT(!jsEvent.IsEmpty());
 
     invokeEventHandler(context, event, jsEvent);

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp (140391 => 140392)


--- trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2013-01-22 08:13:08 UTC (rev 140391)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2013-01-22 08:32:01 UTC (rev 140392)
@@ -354,7 +354,7 @@
     // FIXME: Should we use a new Local handle here?
     v8::Context::Scope contextScope(m_context.get());
 
-    v8::Handle<v8::Value> documentWrapper = toV8(m_frame->document(), v8::Handle<v8::Object>());
+    v8::Handle<v8::Value> documentWrapper = toV8(m_frame->document(), v8::Handle<v8::Object>(), m_context.get()->GetIsolate());
     ASSERT(documentWrapper == m_document.get() || m_document.isEmpty());
     if (m_document.isEmpty())
         updateDocumentWrapper(v8::Handle<v8::Object>::Cast(documentWrapper));

Modified: trunk/Source/WebCore/bindings/v8/V8MutationCallback.cpp (140391 => 140392)


--- trunk/Source/WebCore/bindings/v8/V8MutationCallback.cpp	2013-01-22 08:13:08 UTC (rev 140391)
+++ trunk/Source/WebCore/bindings/v8/V8MutationCallback.cpp	2013-01-22 08:32:01 UTC (rev 140392)
@@ -63,9 +63,9 @@
 
     v8::Local<v8::Array> mutationsArray = v8::Array::New(mutations->size());
     for (size_t i = 0; i < mutations->size(); ++i)
-        mutationsArray->Set(deprecatedV8Integer(i), toV8(mutations->at(i).get(), v8::Handle<v8::Object>()));
+        mutationsArray->Set(deprecatedV8Integer(i), toV8(mutations->at(i).get(), v8::Handle<v8::Object>(), v8Context->GetIsolate()));
 
-    v8::Handle<v8::Value> observerHandle = toV8(observer, v8::Handle<v8::Object>());
+    v8::Handle<v8::Value> observerHandle = toV8(observer, v8::Handle<v8::Object>(), v8Context->GetIsolate());
     if (observerHandle.IsEmpty()) {
         if (!isScriptControllerTerminating())
             CRASH();

Modified: trunk/Source/WebCore/bindings/v8/V8NodeFilterCondition.cpp (140391 => 140392)


--- trunk/Source/WebCore/bindings/v8/V8NodeFilterCondition.cpp	2013-01-22 08:13:08 UTC (rev 140391)
+++ trunk/Source/WebCore/bindings/v8/V8NodeFilterCondition.cpp	2013-01-22 08:32:01 UTC (rev 140392)
@@ -70,10 +70,10 @@
         callback = v8::Handle<v8::Function>::Cast(value);
     }
 
-    v8::Handle<v8::Object> object = v8::Context::GetCurrent()->Global();
     OwnArrayPtr<v8::Handle<v8::Value> > args = adoptArrayPtr(new v8::Handle<v8::Value>[1]);
-    args[0] = toV8(node, v8::Handle<v8::Object>());
+    args[0] = toV8(node, v8::Handle<v8::Object>(), state->isolate());
 
+    v8::Handle<v8::Object> object = v8::Context::GetCurrent()->Global();
     v8::Handle<v8::Value> result = ScriptController::callFunctionWithInstrumentation(0, callback, object, 1, args.get());
 
     if (exceptionCatcher.HasCaught()) {

Modified: trunk/Source/WebCore/bindings/v8/V8WorkerContextEventListener.cpp (140391 => 140392)


--- trunk/Source/WebCore/bindings/v8/V8WorkerContextEventListener.cpp	2013-01-22 08:13:08 UTC (rev 140391)
+++ trunk/Source/WebCore/bindings/v8/V8WorkerContextEventListener.cpp	2013-01-22 08:32:01 UTC (rev 140392)
@@ -75,7 +75,7 @@
     v8::Context::Scope scope(v8Context);
 
     // Get the V8 wrapper for the event object.
-    v8::Handle<v8::Value> jsEvent = toV8(event, v8::Handle<v8::Object>());
+    v8::Handle<v8::Value> jsEvent = toV8(event, v8::Handle<v8::Object>(), v8Context->GetIsolate());
 
     invokeEventHandler(context, event, jsEvent);
 }

Modified: trunk/Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp (140391 => 140392)


--- trunk/Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp	2013-01-22 08:13:08 UTC (rev 140391)
+++ trunk/Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp	2013-01-22 08:32:01 UTC (rev 140392)
@@ -55,8 +55,8 @@
 
     v8::Context::Scope scope(v8Context);
 
-    v8::Handle<v8::Value> transactionHandle = toV8(transaction, v8::Handle<v8::Object>());
-    v8::Handle<v8::Value> errorHandle = toV8(error, v8::Handle<v8::Object>());
+    v8::Handle<v8::Value> transactionHandle = toV8(transaction, v8::Handle<v8::Object>(), v8Context->GetIsolate());
+    v8::Handle<v8::Value> errorHandle = toV8(error, v8::Handle<v8::Object>(), v8Context->GetIsolate());
     if (transactionHandle.IsEmpty() || errorHandle.IsEmpty()) {
         if (!isScriptControllerTerminating())
             CRASH();

Modified: trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp (140391 => 140392)


--- trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp	2013-01-22 08:13:08 UTC (rev 140391)
+++ trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp	2013-01-22 08:32:01 UTC (rev 140392)
@@ -76,7 +76,7 @@
 
     if (!BindingSecurity::shouldAllowAccessToNode(BindingState::instance(), node))
         return ScriptValue(v8::Null());
-    return ScriptValue(toV8(node, v8::Handle<v8::Object>()));
+    return ScriptValue(toV8(node, v8::Handle<v8::Object>(), context->GetIsolate()));
 }
 
 v8::Handle<v8::Value> V8InjectedScriptHost::inspectedObjectCallback(const v8::Arguments& args)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to