| 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/renderer/shared_worker/embedded_shared_worker_stub.h" | 5 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h" |
| 6 | 6 |
| 7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "content/child/appcache/appcache_dispatcher.h" | 8 #include "content/child/appcache/appcache_dispatcher.h" |
| 9 #include "content/child/appcache/web_application_cache_host_impl.h" | 9 #include "content/child/appcache/web_application_cache_host_impl.h" |
| 10 #include "content/child/request_extra_data.h" | 10 #include "content/child/request_extra_data.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 } | 87 } |
| 88 | 88 |
| 89 virtual bool isControlledByServiceWorker( | 89 virtual bool isControlledByServiceWorker( |
| 90 blink::WebDataSource& data_source) { | 90 blink::WebDataSource& data_source) { |
| 91 ServiceWorkerNetworkProvider* provider = | 91 ServiceWorkerNetworkProvider* provider = |
| 92 GetNetworkProviderFromDataSource(&data_source); | 92 GetNetworkProviderFromDataSource(&data_source); |
| 93 return provider->context()->controller_handle_id() != | 93 return provider->context()->controller_handle_id() != |
| 94 kInvalidServiceWorkerHandleId; | 94 kInvalidServiceWorkerHandleId; |
| 95 } | 95 } |
| 96 | 96 |
| 97 virtual int64_t serviceWorkerID( | 97 virtual std::string serviceWorkerID( |
| 98 blink::WebDataSource& data_source) { | 98 blink::WebDataSource& data_source) { |
| 99 ServiceWorkerNetworkProvider* provider = | 99 ServiceWorkerNetworkProvider* provider = |
| 100 GetNetworkProviderFromDataSource(&data_source); | 100 GetNetworkProviderFromDataSource(&data_source); |
| 101 if (provider->context()->controller()) | 101 if (provider->context()->controller()) |
| 102 return provider->context()->controller()->version_id(); | 102 return provider->context()->controller()->version_uuid(); |
| 103 return kInvalidServiceWorkerVersionId; | 103 return std::string(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 private: | 106 private: |
| 107 ServiceWorkerNetworkProvider* GetNetworkProviderFromDataSource( | 107 ServiceWorkerNetworkProvider* GetNetworkProviderFromDataSource( |
| 108 const blink::WebDataSource* data_source) { | 108 const blink::WebDataSource* data_source) { |
| 109 return ServiceWorkerNetworkProvider::FromDocumentState( | 109 return ServiceWorkerNetworkProvider::FromDocumentState( |
| 110 static_cast<DataSourceExtraData*>(data_source->extraData())); | 110 static_cast<DataSourceExtraData*>(data_source->extraData())); |
| 111 } | 111 } |
| 112 }; | 112 }; |
| 113 | 113 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 } | 291 } |
| 292 } | 292 } |
| 293 | 293 |
| 294 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { | 294 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { |
| 295 // After this we wouldn't get any IPC for this stub. | 295 // After this we wouldn't get any IPC for this stub. |
| 296 running_ = false; | 296 running_ = false; |
| 297 impl_->terminateWorkerContext(); | 297 impl_->terminateWorkerContext(); |
| 298 } | 298 } |
| 299 | 299 |
| 300 } // namespace content | 300 } // namespace content |
| OLD | NEW |