Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Unified Diff: Source/bindings/v8/V8MutationCallback.cpp

Issue 218493013: Use NewScriptState in MIDIAccessResolver, CustomElementLifecycleCallbacks and V8MutationCallbacks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/V8MutationCallback.h ('k') | Source/bindings/v8/V8PerContextData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8MutationCallback.cpp
diff --git a/Source/bindings/v8/V8MutationCallback.cpp b/Source/bindings/v8/V8MutationCallback.cpp
index d6110f8d15fe85d21aaf81a807fa2c84002ae3f3..1f0ce99dbd5a702784b343db3ff5d83cad07f1f5 100644
--- a/Source/bindings/v8/V8MutationCallback.cpp
+++ b/Source/bindings/v8/V8MutationCallback.cpp
@@ -39,10 +39,9 @@ namespace WebCore {
V8MutationCallback::V8MutationCallback(v8::Handle<v8::Function> callback, ExecutionContext* context, v8::Handle<v8::Object> owner, v8::Isolate* isolate)
: ActiveDOMCallback(context)
, m_callback(isolate, callback)
- , m_world(DOMWrapperWorld::current(isolate))
- , m_isolate(isolate)
+ , m_scriptState(NewScriptState::current(isolate))
{
- V8HiddenValue::setHiddenValue(m_isolate, owner, V8HiddenValue::callback(m_isolate), callback);
+ V8HiddenValue::setHiddenValue(isolate, owner, V8HiddenValue::callback(isolate), callback);
m_callback.setWeak(this, &setWeakCallback);
}
@@ -51,19 +50,20 @@ void V8MutationCallback::call(const Vector<RefPtr<MutationRecord> >& mutations,
if (!canInvokeCallback())
return;
- v8::HandleScope handleScope(m_isolate);
+ v8::Isolate* isolate = m_scriptState->isolate();
+ v8::HandleScope handleScope(isolate);
- v8::Handle<v8::Context> v8Context = toV8Context(executionContext(), *m_world);
+ v8::Handle<v8::Context> v8Context = m_scriptState->context();
if (v8Context.IsEmpty())
return;
v8::Context::Scope scope(v8Context);
- v8::Handle<v8::Function> callback = m_callback.newLocal(m_isolate);
+ v8::Handle<v8::Function> callback = m_callback.newLocal(isolate);
if (callback.IsEmpty())
return;
- v8::Handle<v8::Value> observerHandle = toV8(observer, v8::Handle<v8::Object>(), m_isolate);
+ v8::Handle<v8::Value> observerHandle = toV8(observer, v8::Handle<v8::Object>(), isolate);
if (observerHandle.IsEmpty()) {
if (!isScriptControllerTerminating())
CRASH();
@@ -74,11 +74,11 @@ void V8MutationCallback::call(const Vector<RefPtr<MutationRecord> >& mutations,
return;
v8::Handle<v8::Object> thisObject = v8::Handle<v8::Object>::Cast(observerHandle);
- v8::Handle<v8::Value> argv[] = { v8Array(mutations, m_isolate), observerHandle };
+ v8::Handle<v8::Value> argv[] = { v8Array(mutations, isolate), observerHandle };
v8::TryCatch exceptionCatcher;
exceptionCatcher.SetVerbose(true);
- ScriptController::callFunction(executionContext(), callback, thisObject, 2, argv, m_isolate);
+ ScriptController::callFunction(executionContext(), callback, thisObject, 2, argv, isolate);
}
void V8MutationCallback::setWeakCallback(const v8::WeakCallbackData<v8::Function, V8MutationCallback>& data)
« no previous file with comments | « Source/bindings/v8/V8MutationCallback.h ('k') | Source/bindings/v8/V8PerContextData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698