OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/service_worker/embedded_worker_instance.h" | 5 #include "content/browser/service_worker/embedded_worker_instance.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 if (started_during_browser_startup_) | 320 if (started_during_browser_startup_) |
321 start_situation = ServiceWorkerMetrics::StartSituation::DURING_STARTUP; | 321 start_situation = ServiceWorkerMetrics::StartSituation::DURING_STARTUP; |
322 else if (is_new_process) | 322 else if (is_new_process) |
323 start_situation = ServiceWorkerMetrics::StartSituation::NEW_PROCESS; | 323 start_situation = ServiceWorkerMetrics::StartSituation::NEW_PROCESS; |
324 else | 324 else |
325 start_situation = ServiceWorkerMetrics::StartSituation::EXISTING_PROCESS; | 325 start_situation = ServiceWorkerMetrics::StartSituation::EXISTING_PROCESS; |
326 | 326 |
327 // Notify the instance that a process is allocated. | 327 // Notify the instance that a process is allocated. |
328 state_ = ProcessAllocationState::ALLOCATED; | 328 state_ = ProcessAllocationState::ALLOCATED; |
329 instance_->OnProcessAllocated( | 329 instance_->OnProcessAllocated( |
330 base::WrapUnique(new WorkerProcessHandle( | 330 base::MakeUnique<WorkerProcessHandle>(instance_->context_, |
331 instance_->context_, instance_->embedded_worker_id(), process_id, | 331 instance_->embedded_worker_id(), |
332 is_new_process)), | 332 process_id, is_new_process), |
333 start_situation); | 333 start_situation); |
334 | 334 |
335 // TODO(bengr): Support changes to this setting while the worker | 335 // TODO(bengr): Support changes to this setting while the worker |
336 // is running. | 336 // is running. |
337 params->settings.data_saver_enabled = settings.data_saver_enabled; | 337 params->settings.data_saver_enabled = settings.data_saver_enabled; |
338 | 338 |
339 // Register the instance to DevToolsManager on UI thread. | 339 // Register the instance to DevToolsManager on UI thread. |
340 const int64_t service_worker_version_id = params->service_worker_version_id; | 340 const int64_t service_worker_version_id = params->service_worker_version_id; |
341 const GURL& scope = params->scope; | 341 const GURL& scope = params->scope; |
342 GURL script_url(params->script_url); | 342 GURL script_url(params->script_url); |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 case SCRIPT_READ_FINISHED: | 885 case SCRIPT_READ_FINISHED: |
886 return "Script read finished"; | 886 return "Script read finished"; |
887 case STARTING_PHASE_MAX_VALUE: | 887 case STARTING_PHASE_MAX_VALUE: |
888 NOTREACHED(); | 888 NOTREACHED(); |
889 } | 889 } |
890 NOTREACHED() << phase; | 890 NOTREACHED() << phase; |
891 return std::string(); | 891 return std::string(); |
892 } | 892 } |
893 | 893 |
894 } // namespace content | 894 } // namespace content |
OLD | NEW |