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

Unified Diff: third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js

Issue 2122353002: [DevTools] Make resource tree model optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 5 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/devtools/front_end/components/ExecutionContextSelector.js
diff --git a/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js b/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js
index 442321322d2a0efb5c1c9d7d100a069045bed320..3ac34873f1e11a6c75bc97cfed773e1a59a778e9 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/ExecutionContextSelector.js
@@ -132,9 +132,12 @@ WebInspector.ExecutionContextSelector.prototype = {
*/
_isMainFrameContext: function(executionContext)
pfeldman 2016/07/07 17:44:14 The name is misleading - we want to know whether t
eostroukhov-old 2016/07/13 23:30:58 Done. Note that the main target check is by checki
{
- if (!executionContext.isDefault)
+ if (!executionContext.isDefault || !executionContext.frameId)
return false;
- var frame = executionContext.target().resourceTreeModel.frameForId(executionContext.frameId);
+ var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(executionContext.target());
+ if (!resourceTreeModel)
+ return false;
+ var frame = resourceTreeModel.frameForId(executionContext.frameId);
if (frame && frame.isMainFrame())
return true;
return false;

Powered by Google App Engine
This is Rietveld 408576698