OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 static PassOwnPtr<UseCounterTask> createCount(UseCounter::Feature feature) {
return adoptPtr(new UseCounterTask(feature, false)); } | 89 static PassOwnPtr<UseCounterTask> createCount(UseCounter::Feature feature) {
return adoptPtr(new UseCounterTask(feature, false)); } |
90 static PassOwnPtr<UseCounterTask> createDeprecation(UseCounter::Feature feat
ure) { return adoptPtr(new UseCounterTask(feature, true)); } | 90 static PassOwnPtr<UseCounterTask> createDeprecation(UseCounter::Feature feat
ure) { return adoptPtr(new UseCounterTask(feature, true)); } |
91 | 91 |
92 private: | 92 private: |
93 UseCounterTask(UseCounter::Feature feature, bool isDeprecation) | 93 UseCounterTask(UseCounter::Feature feature, bool isDeprecation) |
94 : m_feature(feature) | 94 : m_feature(feature) |
95 , m_isDeprecation(isDeprecation) | 95 , m_isDeprecation(isDeprecation) |
96 { | 96 { |
97 } | 97 } |
98 | 98 |
99 virtual void performTask(ExecutionContext* context) override | 99 void performTask(ExecutionContext* context) override |
100 { | 100 { |
101 ASSERT(context->isDocument()); | 101 ASSERT(context->isDocument()); |
102 if (m_isDeprecation) | 102 if (m_isDeprecation) |
103 UseCounter::countDeprecation(context, m_feature); | 103 UseCounter::countDeprecation(context, m_feature); |
104 else | 104 else |
105 UseCounter::count(context, m_feature); | 105 UseCounter::count(context, m_feature); |
106 } | 106 } |
107 | 107 |
108 UseCounter::Feature m_feature; | 108 UseCounter::Feature m_feature; |
109 bool m_isDeprecation; | 109 bool m_isDeprecation; |
110 }; | 110 }; |
111 | 111 |
112 void DedicatedWorkerGlobalScope::countFeature(UseCounter::Feature feature) const | 112 void DedicatedWorkerGlobalScope::countFeature(UseCounter::Feature feature) const |
113 { | 113 { |
114 thread()->workerObjectProxy().postTaskToMainExecutionContext(UseCounterTask:
:createCount(feature)); | 114 thread()->workerObjectProxy().postTaskToMainExecutionContext(UseCounterTask:
:createCount(feature)); |
115 } | 115 } |
116 | 116 |
117 void DedicatedWorkerGlobalScope::countDeprecation(UseCounter::Feature feature) c
onst | 117 void DedicatedWorkerGlobalScope::countDeprecation(UseCounter::Feature feature) c
onst |
118 { | 118 { |
119 thread()->workerObjectProxy().postTaskToMainExecutionContext(UseCounterTask:
:createDeprecation(feature)); | 119 thread()->workerObjectProxy().postTaskToMainExecutionContext(UseCounterTask:
:createDeprecation(feature)); |
120 } | 120 } |
121 | 121 |
122 DEFINE_TRACE(DedicatedWorkerGlobalScope) | 122 DEFINE_TRACE(DedicatedWorkerGlobalScope) |
123 { | 123 { |
124 WorkerGlobalScope::trace(visitor); | 124 WorkerGlobalScope::trace(visitor); |
125 } | 125 } |
126 | 126 |
127 } // namespace blink | 127 } // namespace blink |
OLD | NEW |