| Index: Source/core/workers/DedicatedWorkerGlobalScope.cpp
|
| diff --git a/Source/core/workers/DedicatedWorkerGlobalScope.cpp b/Source/core/workers/DedicatedWorkerGlobalScope.cpp
|
| index 357ca79f4e1cafceb28918280d18aed9bac204e2..c8c0bb038663e2c57620bb37e95557e6764e3075 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 UseCounterTask : public ExecutionContextTask {
|
| +public:
|
| + static PassOwnPtr<UseCounterTask> create(UseCounter::Feature feature) { return adoptPtr(new UseCounterTask(feature)); }
|
| +
|
| +private:
|
| + explicit UseCounterTask(UseCounter::Feature feature) : m_feature(feature) { }
|
| + 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(UseCounterTask::create(feature));
|
| +}
|
| +
|
| void DedicatedWorkerGlobalScope::trace(Visitor* visitor)
|
| {
|
| WorkerGlobalScope::trace(visitor);
|
|
|