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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.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/platform/v8_inspector/V8RuntimeAgentImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
index e7b111aaacfdc8813cf1facdba3e9ad121f0b7e6..5aba3b6887f4cf0c50715b952678371932a99f82 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8RuntimeAgentImpl.cpp
@@ -88,20 +88,11 @@ void V8RuntimeAgentImpl::evaluate(
if (executionContextId.isJust()) {
contextId = executionContextId.fromJust();
} else {
- InspectedContext* mainInGroup = nullptr;
- if (const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_session->contextGroupId())) {
- for (auto& idContext : *contexts) {
- if (idContext.second->isMainInGroup()) {
- mainInGroup = idContext.second;
- break;
- }
- }
- }
- if (!mainInGroup) {
+ contextId = m_debugger->client()->ensureDefaultContextInGroup(m_session->contextGroupId());
+ if (!contextId) {
*errorString = "Cannot find default execution context";
return;
}
- contextId = mainInGroup->contextId();
}
InjectedScript* injectedScript = m_session->findInjectedScript(errorString, contextId);

Powered by Google App Engine
This is Rietveld 408576698