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

Unified Diff: Source/core/inspector/InspectorOverlay.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
Index: Source/core/inspector/InspectorOverlay.cpp
diff --git a/Source/core/inspector/InspectorOverlay.cpp b/Source/core/inspector/InspectorOverlay.cpp
index 0425aa6726d08630f5cec04972160022ce6f6537..af21e99605276eda87fa9a5bd38eafc2e15f1eb4 100644
--- a/Source/core/inspector/InspectorOverlay.cpp
+++ b/Source/core/inspector/InspectorOverlay.cpp
@@ -722,12 +722,11 @@ Page* InspectorOverlay::overlayPage()
RefPtr<SharedBuffer> data = SharedBuffer::create(reinterpret_cast<const char*>(InspectorOverlayPage_html), sizeof(InspectorOverlayPage_html));
loader.load(FrameLoadRequest(0, blankURL(), SubstituteData(data, "text/html", "UTF-8", KURL(), ForceSynchronousLoad)));
v8::Isolate* isolate = toIsolate(frame.get());
- v8::HandleScope handleScope(isolate);
- v8::Handle<v8::Context> frameContext = toV8Context(isolate, frame.get(), DOMWrapperWorld::mainWorld());
- ASSERT(!frameContext.IsEmpty());
- v8::Context::Scope contextScope(frameContext);
- v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), v8::Handle<v8::Object>(), isolate);
- v8::Handle<v8::Object> global = frameContext->Global();
+ ScriptState* scriptState = ScriptState::forMainWorld(frame.get());
+ ASSERT(!scriptState->contextIsEmpty());
+ ScriptState::Scope scope(scriptState);
+ v8::Handle<v8::Object> global = scriptState->context()->Global();
+ v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), global, isolate);
global->Set(v8::String::NewFromUtf8(isolate, "InspectorOverlayHost"), overlayHostObj);
#if OS(WIN)

Powered by Google App Engine
This is Rietveld 408576698