| Index: content/browser/service_worker/embedded_worker_registry.cc
|
| diff --git a/content/browser/service_worker/embedded_worker_registry.cc b/content/browser/service_worker/embedded_worker_registry.cc
|
| index e8c0c86c16d922aca7384566b4e94ed64be672e9..d4ce51f4f03a8586a264cdfe2d495420789aaa8f 100644
|
| --- a/content/browser/service_worker/embedded_worker_registry.cc
|
| +++ b/content/browser/service_worker/embedded_worker_registry.cc
|
| @@ -43,12 +43,6 @@ std::unique_ptr<EmbeddedWorkerInstance> EmbeddedWorkerRegistry::CreateWorker() {
|
| return worker;
|
| }
|
|
|
| -ServiceWorkerStatusCode EmbeddedWorkerRegistry::StopWorker(
|
| - int process_id, int embedded_worker_id) {
|
| - return Send(process_id,
|
| - new EmbeddedWorkerMsg_StopWorker(embedded_worker_id));
|
| -}
|
| -
|
| bool EmbeddedWorkerRegistry::OnMessageReceived(const IPC::Message& message,
|
| int process_id) {
|
| // TODO(kinuko): Move all EmbeddedWorker message handling from
|
| @@ -79,108 +73,23 @@ void EmbeddedWorkerRegistry::Shutdown() {
|
| }
|
| }
|
|
|
| -void EmbeddedWorkerRegistry::OnWorkerReadyForInspection(
|
| - int process_id,
|
| - int embedded_worker_id) {
|
| - EmbeddedWorkerInstance* worker =
|
| - GetWorkerForMessage(process_id, embedded_worker_id);
|
| - if (!worker)
|
| - return;
|
| - worker->OnReadyForInspection();
|
| -}
|
| -
|
| -void EmbeddedWorkerRegistry::OnWorkerScriptLoaded(int process_id,
|
| - int embedded_worker_id) {
|
| - EmbeddedWorkerInstance* worker =
|
| - GetWorkerForMessage(process_id, embedded_worker_id);
|
| - if (!worker)
|
| - return;
|
| - worker->OnScriptLoaded();
|
| -}
|
| -
|
| -void EmbeddedWorkerRegistry::OnWorkerThreadStarted(int process_id,
|
| - int thread_id,
|
| - int embedded_worker_id) {
|
| - EmbeddedWorkerInstance* worker =
|
| - GetWorkerForMessage(process_id, embedded_worker_id);
|
| - if (!worker)
|
| - return;
|
| - worker->OnThreadStarted(thread_id);
|
| -}
|
| -
|
| -void EmbeddedWorkerRegistry::OnWorkerScriptLoadFailed(int process_id,
|
| - int embedded_worker_id) {
|
| - EmbeddedWorkerInstance* worker =
|
| - GetWorkerForMessage(process_id, embedded_worker_id);
|
| - if (!worker)
|
| - return;
|
| - worker->OnScriptLoadFailed();
|
| -}
|
| -
|
| -void EmbeddedWorkerRegistry::OnWorkerScriptEvaluated(int process_id,
|
| - int embedded_worker_id,
|
| - bool success) {
|
| - EmbeddedWorkerInstance* worker =
|
| - GetWorkerForMessage(process_id, embedded_worker_id);
|
| - if (!worker)
|
| - return;
|
| - worker->OnScriptEvaluated(success);
|
| -}
|
| -
|
| -void EmbeddedWorkerRegistry::OnWorkerStarted(
|
| - int process_id, int embedded_worker_id) {
|
| - EmbeddedWorkerInstance* worker =
|
| - GetWorkerForMessage(process_id, embedded_worker_id);
|
| - if (!worker)
|
| - return;
|
| -
|
| +bool EmbeddedWorkerRegistry::OnWorkerStarted(int process_id,
|
| + int embedded_worker_id) {
|
| if (!base::ContainsKey(worker_process_map_, process_id) ||
|
| !base::ContainsKey(worker_process_map_[process_id], embedded_worker_id)) {
|
| - return;
|
| + return false;
|
| }
|
|
|
| - worker->OnStarted();
|
| lifetime_tracker_.StartTiming(embedded_worker_id);
|
| + return true;
|
| }
|
|
|
| -void EmbeddedWorkerRegistry::OnWorkerStopped(
|
| - int process_id, int embedded_worker_id) {
|
| - EmbeddedWorkerInstance* worker =
|
| - GetWorkerForMessage(process_id, embedded_worker_id);
|
| - if (!worker)
|
| - return;
|
| +void EmbeddedWorkerRegistry::OnWorkerStopped(int process_id,
|
| + int embedded_worker_id) {
|
| worker_process_map_[process_id].erase(embedded_worker_id);
|
| - worker->OnStopped();
|
| lifetime_tracker_.StopTiming(embedded_worker_id);
|
| }
|
|
|
| -void EmbeddedWorkerRegistry::OnReportException(
|
| - int embedded_worker_id,
|
| - const base::string16& error_message,
|
| - int line_number,
|
| - int column_number,
|
| - const GURL& source_url) {
|
| - EmbeddedWorkerInstance* worker = GetWorker(embedded_worker_id);
|
| - if (!worker)
|
| - return;
|
| - worker->OnReportException(error_message, line_number, column_number,
|
| - source_url);
|
| -}
|
| -
|
| -void EmbeddedWorkerRegistry::OnReportConsoleMessage(
|
| - int embedded_worker_id,
|
| - int source_identifier,
|
| - int message_level,
|
| - const base::string16& message,
|
| - int line_number,
|
| - const GURL& source_url) {
|
| - EmbeddedWorkerInstance* worker = GetWorker(embedded_worker_id);
|
| - if (!worker)
|
| - return;
|
| - worker->OnReportConsoleMessage(source_identifier, message_level, message,
|
| - line_number, source_url);
|
| -}
|
| -
|
| void EmbeddedWorkerRegistry::OnDevToolsAttached(int embedded_worker_id) {
|
| lifetime_tracker_.AbortTiming(embedded_worker_id);
|
| }
|
|
|