| 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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 status_(EmbeddedWorkerStatus::STOPPED), | 570 status_(EmbeddedWorkerStatus::STOPPED), |
| 571 starting_phase_(NOT_STARTING), | 571 starting_phase_(NOT_STARTING), |
| 572 thread_id_(kInvalidEmbeddedWorkerThreadId), | 572 thread_id_(kInvalidEmbeddedWorkerThreadId), |
| 573 devtools_attached_(false), | 573 devtools_attached_(false), |
| 574 network_accessed_for_script_(false), | 574 network_accessed_for_script_(false), |
| 575 weak_factory_(this) {} | 575 weak_factory_(this) {} |
| 576 | 576 |
| 577 void EmbeddedWorkerInstance::OnProcessAllocated( | 577 void EmbeddedWorkerInstance::OnProcessAllocated( |
| 578 std::unique_ptr<WorkerProcessHandle> handle, | 578 std::unique_ptr<WorkerProcessHandle> handle, |
| 579 ServiceWorkerMetrics::StartSituation start_situation) { | 579 ServiceWorkerMetrics::StartSituation start_situation) { |
| 580 DCHECK_EQ(EmbeddedWorkerStatus::STARTING, status_); | 580 // TODO(shimazu): Change CHECK to DCHECK after crbug.com/668633 is fixed. |
| 581 DCHECK(!process_handle_); | 581 CHECK_EQ(EmbeddedWorkerStatus::STARTING, status_); |
| 582 CHECK(!process_handle_); |
| 582 | 583 |
| 583 process_handle_ = std::move(handle); | 584 process_handle_ = std::move(handle); |
| 584 starting_phase_ = REGISTERING_TO_DEVTOOLS; | 585 starting_phase_ = REGISTERING_TO_DEVTOOLS; |
| 585 start_situation_ = start_situation; | 586 start_situation_ = start_situation; |
| 586 for (auto& observer : listener_list_) | 587 for (auto& observer : listener_list_) |
| 587 observer.OnProcessAllocated(); | 588 observer.OnProcessAllocated(); |
| 588 } | 589 } |
| 589 | 590 |
| 590 void EmbeddedWorkerInstance::OnRegisteredToDevToolsManager( | 591 void EmbeddedWorkerInstance::OnRegisteredToDevToolsManager( |
| 591 bool is_new_process, | 592 bool is_new_process, |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 case SCRIPT_READ_FINISHED: | 943 case SCRIPT_READ_FINISHED: |
| 943 return "Script read finished"; | 944 return "Script read finished"; |
| 944 case STARTING_PHASE_MAX_VALUE: | 945 case STARTING_PHASE_MAX_VALUE: |
| 945 NOTREACHED(); | 946 NOTREACHED(); |
| 946 } | 947 } |
| 947 NOTREACHED() << phase; | 948 NOTREACHED() << phase; |
| 948 return std::string(); | 949 return std::string(); |
| 949 } | 950 } |
| 950 | 951 |
| 951 } // namespace content | 952 } // namespace content |
| OLD | NEW |