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