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

Unified Diff: Source/web/WebDevToolsFrontendImpl.cpp

Issue 306853002: Replace Context::Scope with ScriptState::Scope (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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/web/InspectorFrontendClientImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebDevToolsFrontendImpl.cpp
diff --git a/Source/web/WebDevToolsFrontendImpl.cpp b/Source/web/WebDevToolsFrontendImpl.cpp
index a11c33c96bfa6e6d7a544dff050eddc41b0a6950..a2f47f9fab8664d615d22cb14a15451cedbd3b06 100644
--- a/Source/web/WebDevToolsFrontendImpl.cpp
+++ b/Source/web/WebDevToolsFrontendImpl.cpp
@@ -137,12 +137,9 @@ void WebDevToolsFrontendImpl::doDispatchOnInspectorFrontend(const WebString& mes
if (!frame->frame())
return;
v8::Isolate* isolate = toIsolate(frame->frame());
- v8::HandleScope scope(isolate);
- v8::Handle<v8::Context> frameContext = toV8Context(frame->frame(), DOMWrapperWorld::mainWorld());
- if (frameContext.IsEmpty())
- return;
- v8::Context::Scope contextScope(frameContext);
- v8::Handle<v8::Value> inspectorFrontendApiValue = frameContext->Global()->Get(v8::String::NewFromUtf8(isolate, "InspectorFrontendAPI"));
+ ScriptState* scriptState = ScriptState::forMainWorld(frame->frame());
+ ScriptState::Scope scope(scriptState);
+ v8::Handle<v8::Value> inspectorFrontendApiValue = scriptState->context()->Global()->Get(v8::String::NewFromUtf8(isolate, "InspectorFrontendAPI"));
if (!inspectorFrontendApiValue->IsObject())
return;
v8::Handle<v8::Object> dispatcherObject = v8::Handle<v8::Object>::Cast(inspectorFrontendApiValue);
@@ -151,7 +148,7 @@ void WebDevToolsFrontendImpl::doDispatchOnInspectorFrontend(const WebString& mes
// OR the older version of frontend might have a dispatch method in a different place.
// FIXME(kaznacheev): Remove when Chrome for Android M18 is retired.
if (!dispatchFunction->IsFunction()) {
- v8::Handle<v8::Value> inspectorBackendApiValue = frameContext->Global()->Get(v8::String::NewFromUtf8(isolate, "InspectorBackend"));
+ v8::Handle<v8::Value> inspectorBackendApiValue = scriptState->context()->Global()->Get(v8::String::NewFromUtf8(isolate, "InspectorBackend"));
if (!inspectorBackendApiValue->IsObject())
return;
dispatcherObject = v8::Handle<v8::Object>::Cast(inspectorBackendApiValue);
« no previous file with comments | « Source/web/InspectorFrontendClientImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698