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

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js

Issue 2393763002: [DevTools] Cleanup DOMExtension.js. (Closed)
Patch Set: review comments Created 4 years, 2 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/timeline/TimelineEventOverview.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js
index cae97c9a73d2c530ebcc7d63f2df4fdc6a1e84cc..c6e656acaf6909b1645fe2a02ff8fb8074b11afd 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js
@@ -488,10 +488,19 @@ WebInspector.TimelineFilmStripOverview.prototype = {
*/
function createImage(data)
{
+ var fulfill;
+ var promise = new Promise(f => fulfill = f);
+
var image = /** @type {!HTMLImageElement} */ (createElement("img"));
if (data)
image.src = "data:image/jpg;base64," + data;
- return image.completePromise();
+ if (image.complete) {
+ fulfill(image);
+ } else {
+ image.addEventListener("load", () => fulfill(image));
+ image.addEventListener("error", () => fulfill(image));
+ }
+ return promise;
}
},

Powered by Google App Engine
This is Rietveld 408576698