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

Unified Diff: third_party/WebKit/Source/devtools/front_end/Runtime.js

Issue 2861053003: DevTools: [lighthouse] Implement performance metrics filmstrip (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/Runtime.js
diff --git a/third_party/WebKit/Source/devtools/front_end/Runtime.js b/third_party/WebKit/Source/devtools/front_end/Runtime.js
index aa52da346f7c716c8a4ed26fc5cd9fe23f333b62..0492f72f929527bf7892188fd5aab296c5aab787 100644
--- a/third_party/WebKit/Source/devtools/front_end/Runtime.js
+++ b/third_party/WebKit/Source/devtools/front_end/Runtime.js
@@ -564,19 +564,14 @@ var Runtime = class {
}
/**
- * @param {!Function} constructorFunction
- * @return {!Object}
+ * @template T
+ * @param {function(new:T, ...)} constructorFunction
+ * @return {!T}
*/
sharedInstance(constructorFunction) {
- if (Runtime._instanceSymbol in constructorFunction)
- return constructorFunction[Runtime._instanceSymbol];
- var instance = new constructorFunction();
- constructorFunction[Runtime._instanceSymbol] = instance;
- return instance;
+ return singleton(constructorFunction);
}
-}
-
-;
+};
/**

Powered by Google App Engine
This is Rietveld 408576698