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 28 matching lines...) Expand all Loading... |
39 { | 39 { |
40 } | 40 } |
41 | 41 |
42 const char* WorkerGlobalScopePerformance::supplementName() | 42 const char* WorkerGlobalScopePerformance::supplementName() |
43 { | 43 { |
44 return "WorkerGlobalScopePerformance"; | 44 return "WorkerGlobalScopePerformance"; |
45 } | 45 } |
46 | 46 |
47 WorkerGlobalScopePerformance& WorkerGlobalScopePerformance::from(WorkerGlobalSco
pe& context) | 47 WorkerGlobalScopePerformance& WorkerGlobalScopePerformance::from(WorkerGlobalSco
pe& context) |
48 { | 48 { |
49 WorkerGlobalScopePerformance* supplement = static_cast<WorkerGlobalScopePerf
ormance*>(HeapSupplement<WorkerGlobalScope>::from(context, supplementName())); | 49 WorkerGlobalScopePerformance* supplement = static_cast<WorkerGlobalScopePerf
ormance*>(Supplement<WorkerGlobalScope>::from(context, supplementName())); |
50 if (!supplement) { | 50 if (!supplement) { |
51 supplement = new WorkerGlobalScopePerformance(); | 51 supplement = new WorkerGlobalScopePerformance; |
52 provideTo(context, supplementName(), supplement); | 52 provideTo(context, supplementName(), supplement); |
53 } | 53 } |
54 return *supplement; | 54 return *supplement; |
55 } | 55 } |
56 | 56 |
57 WorkerPerformance* WorkerGlobalScopePerformance::performance(WorkerGlobalScope&
context) | 57 WorkerPerformance* WorkerGlobalScopePerformance::performance(WorkerGlobalScope&
context) |
58 { | 58 { |
59 return from(context).performance(&context); | 59 return from(context).performance(&context); |
60 } | 60 } |
61 | 61 |
62 WorkerPerformance* WorkerGlobalScopePerformance::performance(WorkerGlobalScope*
context) | 62 WorkerPerformance* WorkerGlobalScopePerformance::performance(WorkerGlobalScope*
context) |
63 { | 63 { |
64 if (!m_performance) | 64 if (!m_performance) |
65 m_performance = WorkerPerformance::create(context); | 65 m_performance = WorkerPerformance::create(context); |
66 return m_performance.get(); | 66 return m_performance.get(); |
67 } | 67 } |
68 | 68 |
69 DEFINE_TRACE(WorkerGlobalScopePerformance) | 69 DEFINE_TRACE(WorkerGlobalScopePerformance) |
70 { | 70 { |
71 visitor->trace(m_performance); | 71 visitor->trace(m_performance); |
72 HeapSupplement<WorkerGlobalScope>::trace(visitor); | 72 Supplement<WorkerGlobalScope>::trace(visitor); |
73 } | 73 } |
74 | 74 |
75 } // namespace blink | 75 } // namespace blink |
OLD | NEW |