| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/child/service_worker/service_worker_network_provider.h" | 5 #include "content/child/service_worker/service_worker_network_provider.h" |
| 6 | 6 |
| 7 #include "base/atomic_sequence_num.h" | 7 #include "base/atomic_sequence_num.h" |
| 8 #include "content/child/child_thread_impl.h" | 8 #include "content/child/child_thread_impl.h" |
| 9 #include "content/child/request_extra_data.h" | 9 #include "content/child/request_extra_data.h" |
| 10 #include "content/child/service_worker/service_worker_handle_reference.h" | 10 #include "content/child/service_worker/service_worker_handle_reference.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 blink::WebURLRequest::ServiceWorkerMode::kNone) { | 73 blink::WebURLRequest::ServiceWorkerMode::kNone) { |
| 74 request.SetServiceWorkerMode( | 74 request.SetServiceWorkerMode( |
| 75 blink::WebURLRequest::ServiceWorkerMode::kForeign); | 75 blink::WebURLRequest::ServiceWorkerMode::kForeign); |
| 76 } | 76 } |
| 77 } | 77 } |
| 78 | 78 |
| 79 bool IsControlledByServiceWorker() override { | 79 bool IsControlledByServiceWorker() override { |
| 80 return provider_->IsControlledByServiceWorker(); | 80 return provider_->IsControlledByServiceWorker(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 int GetProviderID() const override { return provider_->provider_id(); } |
| 84 |
| 83 int64_t ServiceWorkerID() override { | 85 int64_t ServiceWorkerID() override { |
| 84 if (provider_->context() && provider_->context()->controller()) | 86 if (provider_->context() && provider_->context()->controller()) |
| 85 return provider_->context()->controller()->version_id(); | 87 return provider_->context()->controller()->version_id(); |
| 86 return kInvalidServiceWorkerVersionId; | 88 return kInvalidServiceWorkerVersionId; |
| 87 } | 89 } |
| 88 | 90 |
| 89 ServiceWorkerNetworkProvider* provider() { return provider_.get(); } | 91 ServiceWorkerNetworkProvider* provider() { return provider_.get(); } |
| 90 | 92 |
| 91 private: | 93 private: |
| 92 std::unique_ptr<ServiceWorkerNetworkProvider> provider_; | 94 std::unique_ptr<ServiceWorkerNetworkProvider> provider_; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 return; // May be null in some tests. | 214 return; // May be null in some tests. |
| 213 dispatcher_host_->OnSetHostedVersionId(provider_id(), version_id, | 215 dispatcher_host_->OnSetHostedVersionId(provider_id(), version_id, |
| 214 embedded_worker_id); | 216 embedded_worker_id); |
| 215 } | 217 } |
| 216 | 218 |
| 217 bool ServiceWorkerNetworkProvider::IsControlledByServiceWorker() const { | 219 bool ServiceWorkerNetworkProvider::IsControlledByServiceWorker() const { |
| 218 return context() && context()->controller(); | 220 return context() && context()->controller(); |
| 219 } | 221 } |
| 220 | 222 |
| 221 } // namespace content | 223 } // namespace content |
| OLD | NEW |