| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 bool last_chance) { | 145 bool last_chance) { |
| 146 context->FindReadyRegistrationForId( | 146 context->FindReadyRegistrationForId( |
| 147 registration_id, origin, | 147 registration_id, origin, |
| 148 base::Bind(&DidFindRegistrationForDispatchSyncEventOnIO, sync_context, | 148 base::Bind(&DidFindRegistrationForDispatchSyncEventOnIO, sync_context, |
| 149 tag, last_chance)); | 149 tag, last_chance)); |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace | 152 } // namespace |
| 153 | 153 |
| 154 ServiceWorkerHandler::ServiceWorkerHandler() | 154 ServiceWorkerHandler::ServiceWorkerHandler() |
| 155 : enabled_(false), render_frame_host_(nullptr), weak_factory_(this) { | 155 : DevToolsDomainHandler(ServiceWorker::Metainfo::domainName), |
| 156 enabled_(false), |
| 157 render_frame_host_(nullptr), |
| 158 weak_factory_(this) { |
| 156 } | 159 } |
| 157 | 160 |
| 158 ServiceWorkerHandler::~ServiceWorkerHandler() { | 161 ServiceWorkerHandler::~ServiceWorkerHandler() { |
| 159 } | 162 } |
| 160 | 163 |
| 161 void ServiceWorkerHandler::Wire(UberDispatcher* dispatcher) { | 164 void ServiceWorkerHandler::Wire(UberDispatcher* dispatcher) { |
| 162 frontend_.reset(new ServiceWorker::Frontend(dispatcher->channel())); | 165 frontend_.reset(new ServiceWorker::Frontend(dispatcher->channel())); |
| 163 ServiceWorker::Dispatcher::wire(dispatcher, this); | 166 ServiceWorker::Dispatcher::wire(dispatcher, this); |
| 164 } | 167 } |
| 165 | 168 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 .Build()); | 432 .Build()); |
| 430 } | 433 } |
| 431 | 434 |
| 432 void ServiceWorkerHandler::ClearForceUpdate() { | 435 void ServiceWorkerHandler::ClearForceUpdate() { |
| 433 if (context_) | 436 if (context_) |
| 434 context_->SetForceUpdateOnPageLoad(false); | 437 context_->SetForceUpdateOnPageLoad(false); |
| 435 } | 438 } |
| 436 | 439 |
| 437 } // namespace protocol | 440 } // namespace protocol |
| 438 } // namespace content | 441 } // namespace content |
| OLD | NEW |