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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
215 loadShadowPage(); | 215 loadShadowPage(); |
216 } | 216 } |
217 | 217 |
218 WebDevToolsAgentClient::WebKitClientMessageLoop* | 218 WebDevToolsAgentClient::WebKitClientMessageLoop* |
219 WebSharedWorkerImpl::createClientMessageLoop() { | 219 WebSharedWorkerImpl::createClientMessageLoop() { |
220 return m_client->createDevToolsMessageLoop(); | 220 return m_client->createDevToolsMessageLoop(); |
221 } | 221 } |
222 | 222 |
223 // WorkerReportingProxy -------------------------------------------------------- | 223 // WorkerReportingProxy -------------------------------------------------------- |
224 | 224 |
225 void WebSharedWorkerImpl::countFeature(UseCounter::Feature) { | 225 void WebSharedWorkerImpl::countFeature(UseCounter::Feature feature) { |
226 // TODO(nhiroki): Support UseCounter for SharedWorker. Send an IPC message to | 226 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.
| |
227 // the browser process and ask each connected document to record API use in | 227 "uint32_t must be larger than number of features"); |
228 // its UseCounter (https://crbug.com/376039). | 228 m_parentFrameTaskRunners->get(TaskType::UnspecedTimer) |
229 ->postTask(BLINK_FROM_HERE, | |
230 crossThreadBind(&WebSharedWorkerClient::countFeature, | |
231 crossThreadUnretained(m_client), | |
232 static_cast<uint32_t>(feature))); | |
229 } | 233 } |
230 | 234 |
231 void WebSharedWorkerImpl::countDeprecation(UseCounter::Feature) { | 235 void WebSharedWorkerImpl::countDeprecation(UseCounter::Feature feature) { |
232 // TODO(nhiroki): Support UseCounter for SharedWorker. Send an IPC message to | 236 // Go through the same code path with countFeature() because a deprecation |
233 // the browser process and ask each connected document to record API use in | 237 // message is already shown on the worker console and a remaining work is just |
234 // its UseCounter (https://crbug.com/376039). | 238 // to record an API use. |
239 countFeature(feature); | |
235 } | 240 } |
236 | 241 |
237 void WebSharedWorkerImpl::reportException(const String& errorMessage, | 242 void WebSharedWorkerImpl::reportException(const String& errorMessage, |
238 std::unique_ptr<SourceLocation>, | 243 std::unique_ptr<SourceLocation>, |
239 int exceptionId) { | 244 int exceptionId) { |
240 // Not suppported in SharedWorker. | 245 // Not suppported in SharedWorker. |
241 } | 246 } |
242 | 247 |
243 void WebSharedWorkerImpl::reportConsoleMessage(MessageSource, | 248 void WebSharedWorkerImpl::reportConsoleMessage(MessageSource, |
244 MessageLevel, | 249 MessageLevel, |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
459 if (devtoolsAgent) | 464 if (devtoolsAgent) |
460 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, | 465 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, |
461 message); | 466 message); |
462 } | 467 } |
463 | 468 |
464 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { | 469 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { |
465 return new WebSharedWorkerImpl(client); | 470 return new WebSharedWorkerImpl(client); |
466 } | 471 } |
467 | 472 |
468 } // namespace blink | 473 } // namespace blink |
OLD | NEW |