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

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

Issue 2592113003: Load data URI images in an async way according to spec (take 3) (Closed)
Patch Set: Fixed more devtools reliance on sync loading Created 3 years, 12 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 5408a32cd8c7932f6772ff46589645b17ff50b53..767c996ce562e190fe7f0fa27e36ad6888ecfb32 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js
@@ -465,13 +465,12 @@ Timeline.TimelineFilmStripOverview = class extends Timeline.TimelineEventOvervie
var promise = new Promise(f => fulfill = f);
var image = /** @type {!HTMLImageElement} */ (createElement('img'));
- if (data)
+ if (data) {
image.src = 'data:image/jpg;base64,' + data;
- if (image.complete) {
- fulfill(image);
- } else {
image.addEventListener('load', () => fulfill(image));
image.addEventListener('error', () => fulfill(image));
+ } else {
+ fulfill(image);
}
return promise;
}

Powered by Google App Engine
This is Rietveld 408576698