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

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

Issue 2534803002: Move InspectorTask handling from MainThreadTaskRunner to Document (Closed)
Patch Set: rebase Created 4 years 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 MessageLevel level, 346 MessageLevel level,
347 const String& message, 347 const String& message,
348 SourceLocation* location) { 348 SourceLocation* location) {
349 client().reportConsoleMessage(source, level, message, location->lineNumber(), 349 client().reportConsoleMessage(source, level, message, location->lineNumber(),
350 location->url()); 350 location->url());
351 } 351 }
352 352
353 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector( 353 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(
354 const String& message) { 354 const String& message) {
355 DCHECK(m_embeddedWorker); 355 DCHECK(m_embeddedWorker);
356 document().postInspectorTask( 356 // The TaskType of Inspector tasks need to be Unthrottled because they need to
357 BLINK_FROM_HERE, 357 // run even on a suspended page.
358 createCrossThreadTask(&WebEmbeddedWorkerImpl::postMessageToPageInspector, 358 getParentFrameTaskRunners()
359 crossThreadUnretained(m_embeddedWorker), message)); 359 ->get(TaskType::Unthrottled)
360 ->postTask(
361 BLINK_FROM_HERE,
362 crossThreadBind(&WebEmbeddedWorkerImpl::postMessageToPageInspector,
363 crossThreadUnretained(m_embeddedWorker), message));
360 } 364 }
361 365
362 ParentFrameTaskRunners* 366 ParentFrameTaskRunners*
363 ServiceWorkerGlobalScopeProxy::getParentFrameTaskRunners() { 367 ServiceWorkerGlobalScopeProxy::getParentFrameTaskRunners() {
364 return m_parentFrameTaskRunners.get(); 368 return m_parentFrameTaskRunners.get();
365 } 369 }
366 370
367 void ServiceWorkerGlobalScopeProxy::didCreateWorkerGlobalScope( 371 void ServiceWorkerGlobalScopeProxy::didCreateWorkerGlobalScope(
368 WorkerOrWorkletGlobalScope* workerGlobalScope) { 372 WorkerOrWorkletGlobalScope* workerGlobalScope) {
369 DCHECK(!m_workerGlobalScope); 373 DCHECK(!m_workerGlobalScope);
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 return *m_document; 454 return *m_document;
451 } 455 }
452 456
453 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() 457 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope()
454 const { 458 const {
455 DCHECK(m_workerGlobalScope); 459 DCHECK(m_workerGlobalScope);
456 return m_workerGlobalScope; 460 return m_workerGlobalScope;
457 } 461 }
458 462
459 } // namespace blink 463 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698