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

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

Issue 2539443004: Worker: Move ParentFrameTaskRunners from WorkerReportingProxy to ObjectProxy (Closed)
Patch Set: rebase 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) 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 SourceLocation* location) { 409 SourceLocation* location) {
410 client().reportConsoleMessage(source, level, message, location->lineNumber(), 410 client().reportConsoleMessage(source, level, message, location->lineNumber(),
411 location->url()); 411 location->url());
412 } 412 }
413 413
414 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector( 414 void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(
415 const String& message) { 415 const String& message) {
416 DCHECK(m_embeddedWorker); 416 DCHECK(m_embeddedWorker);
417 // The TaskType of Inspector tasks need to be Unthrottled because they need to 417 // The TaskType of Inspector tasks need to be Unthrottled because they need to
418 // run even on a suspended page. 418 // run even on a suspended page.
419 getParentFrameTaskRunners() 419 m_parentFrameTaskRunners->get(TaskType::Unthrottled)
420 ->get(TaskType::Unthrottled)
421 ->postTask( 420 ->postTask(
422 BLINK_FROM_HERE, 421 BLINK_FROM_HERE,
423 crossThreadBind(&WebEmbeddedWorkerImpl::postMessageToPageInspector, 422 crossThreadBind(&WebEmbeddedWorkerImpl::postMessageToPageInspector,
424 crossThreadUnretained(m_embeddedWorker), message)); 423 crossThreadUnretained(m_embeddedWorker), message));
425 } 424 }
426 425
427 ParentFrameTaskRunners*
428 ServiceWorkerGlobalScopeProxy::getParentFrameTaskRunners() {
429 return m_parentFrameTaskRunners.get();
430 }
431
432 void ServiceWorkerGlobalScopeProxy::didCreateWorkerGlobalScope( 426 void ServiceWorkerGlobalScopeProxy::didCreateWorkerGlobalScope(
433 WorkerOrWorkletGlobalScope* workerGlobalScope) { 427 WorkerOrWorkletGlobalScope* workerGlobalScope) {
434 DCHECK(!m_workerGlobalScope); 428 DCHECK(!m_workerGlobalScope);
435 m_workerGlobalScope = 429 m_workerGlobalScope =
436 static_cast<ServiceWorkerGlobalScope*>(workerGlobalScope); 430 static_cast<ServiceWorkerGlobalScope*>(workerGlobalScope);
437 client().workerContextStarted(this); 431 client().workerContextStarted(this);
438 } 432 }
439 433
440 void ServiceWorkerGlobalScopeProxy::didInitializeWorkerContext() { 434 void ServiceWorkerGlobalScopeProxy::didInitializeWorkerContext() {
441 ScriptState::Scope scope( 435 ScriptState::Scope scope(
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 return *m_document; 509 return *m_document;
516 } 510 }
517 511
518 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() 512 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope()
519 const { 513 const {
520 DCHECK(m_workerGlobalScope); 514 DCHECK(m_workerGlobalScope);
521 return m_workerGlobalScope; 515 return m_workerGlobalScope;
522 } 516 }
523 517
524 } // namespace blink 518 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h ('k') | third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698