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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js

Issue 2434393002: Timeline: promisify paint profiler and Layers panel, part I (Closed)
Patch Set: review comments addressed 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 return hasChildren; 1401 return hasChildren;
1402 } 1402 }
1403 1403
1404 /** 1404 /**
1405 * @param {!WebInspector.TracingModel.Event} event 1405 * @param {!WebInspector.TracingModel.Event} event
1406 * @param {!WebInspector.Target} target 1406 * @param {!WebInspector.Target} target
1407 * @param {function(!Element=)} callback 1407 * @param {function(!Element=)} callback
1408 */ 1408 */
1409 WebInspector.TimelineUIUtils.buildPicturePreviewContent = function(event, target , callback) 1409 WebInspector.TimelineUIUtils.buildPicturePreviewContent = function(event, target , callback)
1410 { 1410 {
1411 new WebInspector.LayerPaintEvent(event, target).loadSnapshot(onSnapshotLoade d); 1411 new WebInspector.LayerPaintEvent(event, target).snapshotPromise().then(onSna pshotLoaded);
1412 /** 1412 /**
1413 * @param {?Array.<number>} rect 1413 * @param {?{rect: !Array<number>, snapshot: !WebInspector.PaintProfilerSnap shot}} snapshotWithRect
1414 * @param {?WebInspector.PaintProfilerSnapshot} snapshot
1415 */ 1414 */
1416 function onSnapshotLoaded(rect, snapshot) 1415 function onSnapshotLoaded(snapshotWithRect)
1417 { 1416 {
1418 if (!snapshot) { 1417 if (!snapshotWithRect) {
1419 callback(); 1418 callback();
1420 return; 1419 return;
1421 } 1420 }
1422 snapshot.requestImage(null, null, 1, onGotImage); 1421 snapshotWithRect.snapshot.requestImage(null, null, 1, onGotImage);
1423 snapshot.dispose(); 1422 snapshotWithRect.snapshot.dispose();
1424 } 1423 }
1425 1424
1426 /** 1425 /**
1427 * @param {string=} imageURL 1426 * @param {string=} imageURL
1428 */ 1427 */
1429 function onGotImage(imageURL) 1428 function onGotImage(imageURL)
1430 { 1429 {
1431 if (!imageURL) { 1430 if (!imageURL) {
1432 callback(); 1431 callback();
1433 return; 1432 return;
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
2145 case warnings.V8Deopt: 2144 case warnings.V8Deopt:
2146 span.appendChild(WebInspector.linkifyURLAsNode("https://github.com/Googl eChrome/devtools-docs/issues/53", 2145 span.appendChild(WebInspector.linkifyURLAsNode("https://github.com/Googl eChrome/devtools-docs/issues/53",
2147 WebInspector.UIString("Not optimized"), undefined, true)); 2146 WebInspector.UIString("Not optimized"), undefined, true));
2148 span.createTextChild(WebInspector.UIString(": %s", eventData["deoptReaso n"])); 2147 span.createTextChild(WebInspector.UIString(": %s", eventData["deoptReaso n"]));
2149 break; 2148 break;
2150 default: 2149 default:
2151 console.assert(false, "Unhandled TimelineModel.WarningType"); 2150 console.assert(false, "Unhandled TimelineModel.WarningType");
2152 } 2151 }
2153 return span; 2152 return span;
2154 } 2153 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698