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

Unified Diff: third_party/WebKit/Source/core/timing/WorkerGlobalScopePerformance.cpp

Issue 2645303002: Use a new Supplement constructor for supplements in core/ (Closed)
Patch Set: temp Created 3 years, 11 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/core/timing/WorkerGlobalScopePerformance.cpp
diff --git a/third_party/WebKit/Source/core/timing/WorkerGlobalScopePerformance.cpp b/third_party/WebKit/Source/core/timing/WorkerGlobalScopePerformance.cpp
index 71610bfaaf27a7f866e371f1090924690485f216..d613f5f57d3b251c5bd4624b6b84e09465f58092 100644
--- a/third_party/WebKit/Source/core/timing/WorkerGlobalScopePerformance.cpp
+++ b/third_party/WebKit/Source/core/timing/WorkerGlobalScopePerformance.cpp
@@ -35,33 +35,36 @@
namespace blink {
-WorkerGlobalScopePerformance::WorkerGlobalScopePerformance() {}
+WorkerGlobalScopePerformance::WorkerGlobalScopePerformance(
+ WorkerGlobalScope& workerGlobalScope)
+ : Supplement<WorkerGlobalScope>(workerGlobalScope) {}
const char* WorkerGlobalScopePerformance::supplementName() {
return "WorkerGlobalScopePerformance";
}
WorkerGlobalScopePerformance& WorkerGlobalScopePerformance::from(
- WorkerGlobalScope& context) {
+ WorkerGlobalScope& workerGlobalScope) {
WorkerGlobalScopePerformance* supplement =
static_cast<WorkerGlobalScopePerformance*>(
- Supplement<WorkerGlobalScope>::from(context, supplementName()));
+ Supplement<WorkerGlobalScope>::from(workerGlobalScope,
+ supplementName()));
if (!supplement) {
- supplement = new WorkerGlobalScopePerformance;
- provideTo(context, supplementName(), supplement);
+ supplement = new WorkerGlobalScopePerformance(workerGlobalScope);
+ provideTo(workerGlobalScope, supplementName(), supplement);
}
return *supplement;
}
WorkerPerformance* WorkerGlobalScopePerformance::performance(
- WorkerGlobalScope& context) {
- return from(context).performance(&context);
+ WorkerGlobalScope& workerGlobalScope) {
+ return from(workerGlobalScope).performance(&workerGlobalScope);
}
WorkerPerformance* WorkerGlobalScopePerformance::performance(
- WorkerGlobalScope* context) {
+ WorkerGlobalScope* workerGlobalScope) {
if (!m_performance)
- m_performance = WorkerPerformance::create(context);
+ m_performance = WorkerPerformance::create(workerGlobalScope);
return m_performance.get();
}

Powered by Google App Engine
This is Rietveld 408576698