OLD | NEW |
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 Loading... |
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 |
OLD | NEW |