| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "content/renderer/devtools/devtools_agent.h" | 22 #include "content/renderer/devtools/devtools_agent.h" |
| 23 #include "content/renderer/render_thread_impl.h" | 23 #include "content/renderer/render_thread_impl.h" |
| 24 #include "content/renderer/shared_worker/embedded_shared_worker_content_settings
_client_proxy.h" | 24 #include "content/renderer/shared_worker/embedded_shared_worker_content_settings
_client_proxy.h" |
| 25 #include "ipc/ipc_message_macros.h" | 25 #include "ipc/ipc_message_macros.h" |
| 26 #include "third_party/WebKit/public/platform/URLConversion.h" | 26 #include "third_party/WebKit/public/platform/URLConversion.h" |
| 27 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 27 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 28 #include "third_party/WebKit/public/web/WebDataSource.h" | 28 #include "third_party/WebKit/public/web/WebDataSource.h" |
| 29 #include "third_party/WebKit/public/web/WebSharedWorker.h" | 29 #include "third_party/WebKit/public/web/WebSharedWorker.h" |
| 30 #include "third_party/WebKit/public/web/WebSharedWorkerClient.h" | 30 #include "third_party/WebKit/public/web/WebSharedWorkerClient.h" |
| 31 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerNe
tworkProvider.h" | 31 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerNe
tworkProvider.h" |
| 32 #include "url/origin.h" |
| 32 | 33 |
| 33 namespace content { | 34 namespace content { |
| 34 | 35 |
| 35 namespace { | 36 namespace { |
| 36 | 37 |
| 37 class SharedWorkerWebApplicationCacheHostImpl | 38 class SharedWorkerWebApplicationCacheHostImpl |
| 38 : public WebApplicationCacheHostImpl { | 39 : public WebApplicationCacheHostImpl { |
| 39 public: | 40 public: |
| 40 SharedWorkerWebApplicationCacheHostImpl( | 41 SharedWorkerWebApplicationCacheHostImpl( |
| 41 blink::WebApplicationCacheHostClient* client) | 42 blink::WebApplicationCacheHostClient* client) |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 EmbeddedSharedWorkerStub::createApplicationCacheHost( | 231 EmbeddedSharedWorkerStub::createApplicationCacheHost( |
| 231 blink::WebApplicationCacheHostClient* client) { | 232 blink::WebApplicationCacheHostClient* client) { |
| 232 app_cache_host_ = new SharedWorkerWebApplicationCacheHostImpl(client); | 233 app_cache_host_ = new SharedWorkerWebApplicationCacheHostImpl(client); |
| 233 return app_cache_host_; | 234 return app_cache_host_; |
| 234 } | 235 } |
| 235 | 236 |
| 236 blink::WebWorkerContentSettingsClientProxy* | 237 blink::WebWorkerContentSettingsClientProxy* |
| 237 EmbeddedSharedWorkerStub::createWorkerContentSettingsClientProxy( | 238 EmbeddedSharedWorkerStub::createWorkerContentSettingsClientProxy( |
| 238 const blink::WebSecurityOrigin& origin) { | 239 const blink::WebSecurityOrigin& origin) { |
| 239 return new EmbeddedSharedWorkerContentSettingsClientProxy( | 240 return new EmbeddedSharedWorkerContentSettingsClientProxy( |
| 240 blink::WebStringToGURL(origin.toString()), | 241 url::Origin(origin).GetURL(), origin.isUnique(), route_id_, |
| 241 origin.isUnique(), | |
| 242 route_id_, | |
| 243 ChildThreadImpl::current()->thread_safe_sender()); | 242 ChildThreadImpl::current()->thread_safe_sender()); |
| 244 } | 243 } |
| 245 | 244 |
| 246 blink::WebServiceWorkerNetworkProvider* | 245 blink::WebServiceWorkerNetworkProvider* |
| 247 EmbeddedSharedWorkerStub::createServiceWorkerNetworkProvider( | 246 EmbeddedSharedWorkerStub::createServiceWorkerNetworkProvider( |
| 248 blink::WebDataSource* data_source) { | 247 blink::WebDataSource* data_source) { |
| 249 // Create a content::ServiceWorkerNetworkProvider for this data source so | 248 // Create a content::ServiceWorkerNetworkProvider for this data source so |
| 250 // we can observe its requests. | 249 // we can observe its requests. |
| 251 std::unique_ptr<ServiceWorkerNetworkProvider> provider( | 250 std::unique_ptr<ServiceWorkerNetworkProvider> provider( |
| 252 new ServiceWorkerNetworkProvider( | 251 new ServiceWorkerNetworkProvider( |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 } | 311 } |
| 313 } | 312 } |
| 314 | 313 |
| 315 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { | 314 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { |
| 316 // After this we wouldn't get any IPC for this stub. | 315 // After this we wouldn't get any IPC for this stub. |
| 317 running_ = false; | 316 running_ = false; |
| 318 impl_->terminateWorkerContext(); | 317 impl_->terminateWorkerContext(); |
| 319 } | 318 } |
| 320 | 319 |
| 321 } // namespace content | 320 } // namespace content |
| OLD | NEW |