| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |