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

Unified Diff: third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp

Issue 1873533002: [DevTools] Force context creation when runtime is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more tests Created 4 years, 8 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: third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
diff --git a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
index c678024f937f1386e4cad445083542b8df493987..1263f5c57531c3cddbb564157202b0ad4d27102f 100644
--- a/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
+++ b/third_party/WebKit/Source/core/inspector/MainThreadDebugger.cpp
@@ -101,10 +101,9 @@ void MainThreadDebugger::contextCreated(ScriptState* scriptState, LocalFrame* fr
ASSERT(isMainThread());
v8::HandleScope handles(scriptState->isolate());
DOMWrapperWorld& world = scriptState->world();
- bool isMainContext = frame->localFrameRoot() == frame && world.isMainWorld();
- if (isMainContext)
+ if (frame->localFrameRoot() == frame && world.isMainWorld())
debugger()->resetContextGroup(contextGroupId(frame));
- debugger()->contextCreated(V8ContextInfo(scriptState->context(), contextGroupId(frame), isMainContext, world.isMainWorld(), origin ? origin->toRawString() : "", world.isIsolatedWorld() ? world.isolatedWorldHumanReadableName() : "", IdentifiersFactory::frameId(frame)));
+ debugger()->contextCreated(V8ContextInfo(scriptState->context(), contextGroupId(frame), world.isMainWorld(), origin ? origin->toRawString() : "", world.isIsolatedWorld() ? world.isolatedWorldHumanReadableName() : "", IdentifiersFactory::frameId(frame)));
}
void MainThreadDebugger::contextWillBeDestroyed(ScriptState* scriptState)
@@ -193,4 +192,16 @@ bool MainThreadDebugger::callingContextCanAccessContext(v8::Local<v8::Context> c
return window && BindingSecurity::shouldAllowAccessTo(m_isolate, toLocalDOMWindow(toDOMWindow(calling)), window, DoNotReportSecurityError);
}
+int MainThreadDebugger::ensureDefaultContextInGroup(int contextGroupId)
+{
+ LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId);
+ if (!frame)
+ return 0;
+ ScriptState* scriptState = ScriptState::forMainWorld(frame);
+ if (!scriptState)
+ return 0;
+ v8::HandleScope scopes(scriptState->isolate());
+ return V8Debugger::contextId(scriptState->context());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698