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

Side by Side Diff: Source/devtools/front_end/platform/utilities.js

Issue 710033003: [DevTools] Extract part of DevTools into inspector app. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google 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 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. 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 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 1428
1429 /** 1429 /**
1430 * @param {function()} callback 1430 * @param {function()} callback
1431 * @return {number} 1431 * @return {number}
1432 */ 1432 */
1433 self.setImmediate = function(callback) 1433 self.setImmediate = function(callback)
1434 { 1434 {
1435 Promise.resolve().then(callback).done(); 1435 Promise.resolve().then(callback).done();
1436 return 0; 1436 return 0;
1437 } 1437 }
1438
1439 /**
1440 * @param {!function()} callback
1441 * @suppressGlobalPropertiesCheck
1442 */
1443 function runOnWindowLoad(callback)
1444 {
1445 /**
1446 * @suppressGlobalPropertiesCheck
1447 */
1448 function windowLoaded()
1449 {
1450 window.removeEventListener("DOMContentLoaded", windowLoaded, false);
1451 callback();
1452 }
1453
1454 if (document.readyState === "complete")
1455 callback();
1456 else
1457 window.addEventListener("DOMContentLoaded", windowLoaded, false);
1458 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698