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