| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/devtools/protocol/service_worker_handler.h" | 5 #include "content/browser/devtools/protocol/service_worker_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/containers/scoped_ptr_hash_map.h" | 8 #include "base/containers/scoped_ptr_hash_map.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 case DevToolsAgentHost::TYPE_BROWSER: | 223 case DevToolsAgentHost::TYPE_BROWSER: |
| 224 return "browser"; | 224 return "browser"; |
| 225 } | 225 } |
| 226 NOTREACHED() << type; | 226 NOTREACHED() << type; |
| 227 return std::string(); | 227 return std::string(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace | 230 } // namespace |
| 231 | 231 |
| 232 ServiceWorkerHandler::ServiceWorkerHandler() | 232 ServiceWorkerHandler::ServiceWorkerHandler() |
| 233 : enabled_(false), weak_factory_(this) { | 233 : enabled_(false), render_frame_host_(nullptr), weak_factory_(this) { |
| 234 } | 234 } |
| 235 | 235 |
| 236 ServiceWorkerHandler::~ServiceWorkerHandler() { | 236 ServiceWorkerHandler::~ServiceWorkerHandler() { |
| 237 Disable(); | 237 Disable(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 void ServiceWorkerHandler::SetRenderFrameHost( | 240 void ServiceWorkerHandler::SetRenderFrameHost( |
| 241 RenderFrameHostImpl* render_frame_host) { | 241 RenderFrameHostImpl* render_frame_host) { |
| 242 render_frame_host_ = render_frame_host; | 242 render_frame_host_ = render_frame_host; |
| 243 // Do not call UpdateHosts yet, wait for load to commit. | 243 // Do not call UpdateHosts yet, wait for load to commit. |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 return; | 588 return; |
| 589 host->DetachClient(); | 589 host->DetachClient(); |
| 590 client_->WorkerTerminated(WorkerTerminatedParams::Create()-> | 590 client_->WorkerTerminated(WorkerTerminatedParams::Create()-> |
| 591 set_worker_id(host->GetId())); | 591 set_worker_id(host->GetId())); |
| 592 attached_hosts_.erase(it); | 592 attached_hosts_.erase(it); |
| 593 } | 593 } |
| 594 | 594 |
| 595 } // namespace service_worker | 595 } // namespace service_worker |
| 596 } // namespace devtools | 596 } // namespace devtools |
| 597 } // namespace content | 597 } // namespace content |
| OLD | NEW |