Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Side by Side Diff: third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp

Issue 2586863002: Worker: Enable UseCounter for SharedWorkerGlobalScope (Closed)
Patch Set: ready to review Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 static_assert(UseCounter::NumberOfFeatures < UINT32_MAX,
236 // the browser process and ask each connected document to record API use in 240 "uint32_t must be larger than number of features");
237 // its UseCounter (https://crbug.com/376039). 241
242 // Go through the same code path with countFeature() because a deprecation
243 // message is already shown on the worker console and a remaining work is just
244 // to record an API use.
245 m_parentFrameTaskRunners->get(TaskType::UnspecedTimer)
246 ->postTask(BLINK_FROM_HERE,
247 crossThreadBind(&WebSharedWorkerClient::countFeature,
248 crossThreadUnretained(m_client),
249 static_cast<uint32_t>(feature)));
kinuko 2017/01/24 13:56:31 nit: if we do exactly same as countFeature, we can
nhiroki 2017/01/25 10:16:12 Done.
238 } 250 }
239 251
240 void WebSharedWorkerImpl::reportException(const String& errorMessage, 252 void WebSharedWorkerImpl::reportException(const String& errorMessage,
241 std::unique_ptr<SourceLocation>, 253 std::unique_ptr<SourceLocation>,
242 int exceptionId) { 254 int exceptionId) {
243 // Not suppported in SharedWorker. 255 // Not suppported in SharedWorker.
244 } 256 }
245 257
246 void WebSharedWorkerImpl::reportConsoleMessage(MessageSource, 258 void WebSharedWorkerImpl::reportConsoleMessage(MessageSource,
247 MessageLevel, 259 MessageLevel,
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 if (devtoolsAgent) 474 if (devtoolsAgent)
463 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, 475 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method,
464 message); 476 message);
465 } 477 }
466 478
467 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { 479 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) {
468 return new WebSharedWorkerImpl(client); 480 return new WebSharedWorkerImpl(client);
469 } 481 }
470 482
471 } // namespace blink 483 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698