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