Chromium Code Reviews| Index: third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp |
| diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp |
| index 7c2cecea6df0ac8b16342a0e92b9933b2b898746..bbfc936346319d63d5f76d802b364fc550342673 100644 |
| --- a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp |
| @@ -222,16 +222,21 @@ WebSharedWorkerImpl::createClientMessageLoop() { |
| // WorkerReportingProxy -------------------------------------------------------- |
| -void WebSharedWorkerImpl::countFeature(UseCounter::Feature) { |
| - // TODO(nhiroki): Support UseCounter for SharedWorker. Send an IPC message to |
| - // the browser process and ask each connected document to record API use in |
| - // its UseCounter (https://crbug.com/376039). |
| +void WebSharedWorkerImpl::countFeature(UseCounter::Feature feature) { |
| + static_assert(UseCounter::NumberOfFeatures < UINT32_MAX, |
|
dcheng
2017/02/03 00:40:40
Another option is just to write this in UseCounter
nhiroki
2017/02/03 17:28:22
Good idea! Added it and removed static_asserts.
|
| + "uint32_t must be larger than number of features"); |
| + m_parentFrameTaskRunners->get(TaskType::UnspecedTimer) |
| + ->postTask(BLINK_FROM_HERE, |
| + crossThreadBind(&WebSharedWorkerClient::countFeature, |
| + crossThreadUnretained(m_client), |
| + static_cast<uint32_t>(feature))); |
| } |
| -void WebSharedWorkerImpl::countDeprecation(UseCounter::Feature) { |
| - // TODO(nhiroki): Support UseCounter for SharedWorker. Send an IPC message to |
| - // the browser process and ask each connected document to record API use in |
| - // its UseCounter (https://crbug.com/376039). |
| +void WebSharedWorkerImpl::countDeprecation(UseCounter::Feature feature) { |
| + // Go through the same code path with countFeature() because a deprecation |
| + // message is already shown on the worker console and a remaining work is just |
| + // to record an API use. |
| + countFeature(feature); |
| } |
| void WebSharedWorkerImpl::reportException(const String& errorMessage, |