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

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

Issue 2861053003: DevTools: [lighthouse] Implement performance metrics filmstrip (Closed)
Patch Set: test fixed Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/emulation/InspectedPagePlaceholder.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 function windowLoaded() { 1437 function windowLoaded() {
1438 self.removeEventListener('DOMContentLoaded', windowLoaded, false); 1438 self.removeEventListener('DOMContentLoaded', windowLoaded, false);
1439 callback(); 1439 callback();
1440 } 1440 }
1441 1441
1442 if (document.readyState === 'complete' || document.readyState === 'interactive ') 1442 if (document.readyState === 'complete' || document.readyState === 'interactive ')
1443 callback(); 1443 callback();
1444 else 1444 else
1445 self.addEventListener('DOMContentLoaded', windowLoaded, false); 1445 self.addEventListener('DOMContentLoaded', windowLoaded, false);
1446 } 1446 }
1447
1448 var _singletonSymbol = Symbol('singleton');
1449
1450 /**
1451 * @template T
1452 * @param {function(new:T, ...)} constructorFunction
1453 * @return {!T}
1454 */
1455 function singleton(constructorFunction) {
1456 if (_singletonSymbol in constructorFunction)
1457 return constructorFunction[_singletonSymbol];
1458 var instance = new constructorFunction();
1459 constructorFunction[_singletonSymbol] = instance;
1460 return instance;
1461 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/emulation/InspectedPagePlaceholder.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698