Index: Source/core/workers/DedicatedWorkerGlobalScope.cpp |
diff --git a/Source/core/workers/DedicatedWorkerGlobalScope.cpp b/Source/core/workers/DedicatedWorkerGlobalScope.cpp |
index 357ca79f4e1cafceb28918280d18aed9bac204e2..cf30616813de29cddb3ce78f5ce786a5550588a7 100644 |
--- a/Source/core/workers/DedicatedWorkerGlobalScope.cpp |
+++ b/Source/core/workers/DedicatedWorkerGlobalScope.cpp |
@@ -78,11 +78,30 @@ void DedicatedWorkerGlobalScope::importScripts(const Vector<String>& urls, Excep |
thread()->workerObjectProxy().reportPendingActivity(hasPendingActivity()); |
} |
-DedicatedWorkerThread* DedicatedWorkerGlobalScope::thread() |
+DedicatedWorkerThread* DedicatedWorkerGlobalScope::thread() const |
{ |
return static_cast<DedicatedWorkerThread*>(Base::thread()); |
} |
+class CounterTask : public ExecutionContextTask { |
haraken
2014/06/19 05:29:01
CounterTask => UseCounterTask ?
tkent
2014/06/19 05:34:09
Done.
|
+public: |
+ static PassOwnPtr<CounterTask> create(UseCounter::Feature feature) { return adoptPtr(new CounterTask(feature)); } |
+ |
+private: |
+ CounterTask(UseCounter::Feature feature) : m_feature(feature) { } |
haraken
2014/06/19 05:29:01
Add explicit.
tkent
2014/06/19 05:34:09
Done.
|
+ virtual void performTask(ExecutionContext* context) OVERRIDE |
+ { |
+ UseCounter::count(*toDocument(context), m_feature); |
+ } |
+ |
+ UseCounter::Feature m_feature; |
+}; |
+ |
+void DedicatedWorkerGlobalScope::countFeature(UseCounter::Feature feature) const |
+{ |
+ thread()->workerObjectProxy().postTaskToMainExecutionContext(CounterTask::create(feature)); |
+} |
+ |
void DedicatedWorkerGlobalScope::trace(Visitor* visitor) |
{ |
WorkerGlobalScope::trace(visitor); |