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

Side by Side Diff: Source/modules/performance/WorkerGlobalScopePerformance.cpp

Issue 1100813004: Offer User Timing in workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 6 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 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 WorkerGlobalScopePerformance* supplement = static_cast<WorkerGlobalScopePerf ormance*>(WillBeHeapSupplement<WorkerGlobalScope>::from(context, supplementName( ))); 51 WorkerGlobalScopePerformance* supplement = static_cast<WorkerGlobalScopePerf ormance*>(WillBeHeapSupplement<WorkerGlobalScope>::from(context, supplementName( )));
52 if (!supplement) { 52 if (!supplement) {
53 supplement = new WorkerGlobalScopePerformance(); 53 supplement = new WorkerGlobalScopePerformance();
54 provideTo(context, supplementName(), adoptPtrWillBeNoop(supplement)); 54 provideTo(context, supplementName(), adoptPtrWillBeNoop(supplement));
55 } 55 }
56 return *supplement; 56 return *supplement;
57 } 57 }
58 58
59 WorkerPerformance* WorkerGlobalScopePerformance::performance(WorkerGlobalScope& context) 59 WorkerPerformance* WorkerGlobalScopePerformance::performance(WorkerGlobalScope& context)
60 { 60 {
61 return from(context).performance(); 61 return from(context).performance(&context);
62 } 62 }
63 63
64 WorkerPerformance* WorkerGlobalScopePerformance::performance() 64 WorkerPerformance* WorkerGlobalScopePerformance::performance(WorkerGlobalScope* context)
65 { 65 {
66 if (!m_performance) 66 if (!m_performance)
67 m_performance = WorkerPerformance::create(); 67 m_performance = WorkerPerformance::create(context);
68 return m_performance.get(); 68 return m_performance.get();
69 } 69 }
70 70
71 DEFINE_TRACE(WorkerGlobalScopePerformance) 71 DEFINE_TRACE(WorkerGlobalScopePerformance)
72 { 72 {
73 visitor->trace(m_performance); 73 visitor->trace(m_performance);
74 WillBeHeapSupplement<WorkerGlobalScope>::trace(visitor); 74 WillBeHeapSupplement<WorkerGlobalScope>::trace(visitor);
75 } 75 }
76 76
77 } // namespace blink 77 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/performance/WorkerGlobalScopePerformance.h ('k') | Source/modules/performance/WorkerPerformance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698