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

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

Issue 2122353002: [DevTools] Make resource tree model optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 4 years, 4 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/DOMPresentationUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/components/DOMPresentationUtils.js b/third_party/WebKit/Source/devtools/front_end/components/DOMPresentationUtils.js
index 2347ad521bfae62a6e034df302ef24ae7c486265..4f9e5fac6378a60b1fbb3943094af577f7bf932d 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/DOMPresentationUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/DOMPresentationUtils.js
@@ -159,11 +159,16 @@ WebInspector.DOMPresentationUtils.linkifyDeferredNodeReference = function(deferr
*/
WebInspector.DOMPresentationUtils.buildImagePreviewContents = function(target, originalImageURL, showDimensions, userCallback, precomputedFeatures)
{
- var resource = target.resourceTreeModel.resourceForURL(originalImageURL);
+ var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target);
+ if (!resourceTreeModel) {
+ userCallback();
+ return;
+ }
+ var resource = resourceTreeModel.resourceForURL(originalImageURL);
var imageURL = originalImageURL;
if (!isImageResource(resource) && precomputedFeatures && precomputedFeatures.currentSrc) {
imageURL = precomputedFeatures.currentSrc;
- resource = target.resourceTreeModel.resourceForURL(imageURL);
+ resource = resourceTreeModel.resourceForURL(imageURL);
}
if (!isImageResource(resource)) {
userCallback();

Powered by Google App Engine
This is Rietveld 408576698