| 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 void ServiceWorkerGlobalScopeProxy::ReportConsoleMessage( | 504 void ServiceWorkerGlobalScopeProxy::ReportConsoleMessage( |
| 505 MessageSource source, | 505 MessageSource source, |
| 506 MessageLevel level, | 506 MessageLevel level, |
| 507 const String& message, | 507 const String& message, |
| 508 SourceLocation* location) { | 508 SourceLocation* location) { |
| 509 Client().ReportConsoleMessage(source, level, message, location->LineNumber(), | 509 Client().ReportConsoleMessage(source, level, message, location->LineNumber(), |
| 510 location->Url()); | 510 location->Url()); |
| 511 } | 511 } |
| 512 | 512 |
| 513 void ServiceWorkerGlobalScopeProxy::PostMessageToPageInspector( | 513 void ServiceWorkerGlobalScopeProxy::PostMessageToPageInspector( |
| 514 int session_id, |
| 514 const String& message) { | 515 const String& message) { |
| 515 DCHECK(embedded_worker_); | 516 DCHECK(embedded_worker_); |
| 516 // The TaskType of Inspector tasks need to be Unthrottled because they need to | 517 // The TaskType of Inspector tasks need to be Unthrottled because they need to |
| 517 // run even on a suspended page. | 518 // run even on a suspended page. |
| 518 parent_frame_task_runners_->Get(TaskType::kUnthrottled) | 519 parent_frame_task_runners_->Get(TaskType::kUnthrottled) |
| 519 ->PostTask( | 520 ->PostTask( |
| 520 BLINK_FROM_HERE, | 521 BLINK_FROM_HERE, |
| 521 CrossThreadBind(&WebEmbeddedWorkerImpl::PostMessageToPageInspector, | 522 CrossThreadBind(&WebEmbeddedWorkerImpl::PostMessageToPageInspector, |
| 522 CrossThreadUnretained(embedded_worker_), message)); | 523 CrossThreadUnretained(embedded_worker_), session_id, |
| 524 message)); |
| 523 } | 525 } |
| 524 | 526 |
| 525 void ServiceWorkerGlobalScopeProxy::DidCreateWorkerGlobalScope( | 527 void ServiceWorkerGlobalScopeProxy::DidCreateWorkerGlobalScope( |
| 526 WorkerOrWorkletGlobalScope* worker_global_scope) { | 528 WorkerOrWorkletGlobalScope* worker_global_scope) { |
| 527 DCHECK(!worker_global_scope_); | 529 DCHECK(!worker_global_scope_); |
| 528 worker_global_scope_ = | 530 worker_global_scope_ = |
| 529 static_cast<ServiceWorkerGlobalScope*>(worker_global_scope); | 531 static_cast<ServiceWorkerGlobalScope*>(worker_global_scope); |
| 530 Client().WorkerContextStarted(this); | 532 Client().WorkerContextStarted(this); |
| 531 } | 533 } |
| 532 | 534 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 return *client_; | 600 return *client_; |
| 599 } | 601 } |
| 600 | 602 |
| 601 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::WorkerGlobalScope() | 603 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::WorkerGlobalScope() |
| 602 const { | 604 const { |
| 603 DCHECK(worker_global_scope_); | 605 DCHECK(worker_global_scope_); |
| 604 return worker_global_scope_; | 606 return worker_global_scope_; |
| 605 } | 607 } |
| 606 | 608 |
| 607 } // namespace blink | 609 } // namespace blink |
| OLD | NEW |