| 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" |
| 11 #include "content/child/appcache/appcache_dispatcher.h" | 11 #include "content/child/appcache/appcache_dispatcher.h" |
| 12 #include "content/child/appcache/web_application_cache_host_impl.h" | 12 #include "content/child/appcache/web_application_cache_host_impl.h" |
| 13 #include "content/child/request_extra_data.h" | 13 #include "content/child/request_extra_data.h" |
| 14 #include "content/child/scoped_child_process_reference.h" | 14 #include "content/child/scoped_child_process_reference.h" |
| 15 #include "content/child/service_worker/service_worker_handle_reference.h" | 15 #include "content/child/service_worker/service_worker_handle_reference.h" |
| 16 #include "content/child/service_worker/service_worker_network_provider.h" | 16 #include "content/child/service_worker/service_worker_network_provider.h" |
| 17 #include "content/child/service_worker/service_worker_provider_context.h" | 17 #include "content/child/service_worker/service_worker_provider_context.h" |
| 18 #include "content/child/shared_worker_devtools_agent.h" | 18 #include "content/child/shared_worker_devtools_agent.h" |
| 19 #include "content/child/webmessageportchannel_impl.h" | 19 #include "content/child/webmessageportchannel_impl.h" |
| 20 #include "content/common/worker_messages.h" | 20 #include "content/common/worker_messages.h" |
| 21 #include "content/public/common/appcache_info.h" |
| 21 #include "content/public/common/origin_util.h" | 22 #include "content/public/common/origin_util.h" |
| 22 #include "content/renderer/devtools/devtools_agent.h" | 23 #include "content/renderer/devtools/devtools_agent.h" |
| 23 #include "content/renderer/render_thread_impl.h" | 24 #include "content/renderer/render_thread_impl.h" |
| 24 #include "content/renderer/shared_worker/embedded_shared_worker_content_settings
_client_proxy.h" | 25 #include "content/renderer/shared_worker/embedded_shared_worker_content_settings
_client_proxy.h" |
| 25 #include "ipc/ipc_message_macros.h" | 26 #include "ipc/ipc_message_macros.h" |
| 26 #include "third_party/WebKit/public/platform/URLConversion.h" | 27 #include "third_party/WebKit/public/platform/URLConversion.h" |
| 27 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 28 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 28 #include "third_party/WebKit/public/web/WebDataSource.h" | 29 #include "third_party/WebKit/public/web/WebDataSource.h" |
| 29 #include "third_party/WebKit/public/web/WebSharedWorker.h" | 30 #include "third_party/WebKit/public/web/WebSharedWorker.h" |
| 30 #include "third_party/WebKit/public/web/WebSharedWorkerClient.h" | 31 #include "third_party/WebKit/public/web/WebSharedWorkerClient.h" |
| 31 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerNe
tworkProvider.h" | 32 #include "third_party/WebKit/public/web/modules/serviceworker/WebServiceWorkerNe
tworkProvider.h" |
| 32 #include "url/origin.h" | 33 #include "url/origin.h" |
| 33 | 34 |
| 34 namespace content { | 35 namespace content { |
| 35 | 36 |
| 36 namespace { | 37 namespace { |
| 37 | 38 |
| 38 class SharedWorkerWebApplicationCacheHostImpl | 39 class SharedWorkerWebApplicationCacheHostImpl |
| 39 : public WebApplicationCacheHostImpl { | 40 : public WebApplicationCacheHostImpl { |
| 40 public: | 41 public: |
| 41 SharedWorkerWebApplicationCacheHostImpl( | 42 SharedWorkerWebApplicationCacheHostImpl( |
| 42 blink::WebApplicationCacheHostClient* client) | 43 blink::WebApplicationCacheHostClient* client) |
| 43 : WebApplicationCacheHostImpl(client, | 44 : WebApplicationCacheHostImpl( |
| 44 RenderThreadImpl::current() | 45 client, |
| 45 ->appcache_dispatcher() | 46 RenderThreadImpl::current()->appcache_dispatcher()->backend_proxy(), |
| 46 ->backend_proxy()) {} | 47 kAppCacheNoHostId) {} |
| 47 | 48 |
| 48 // Main resource loading is different for workers. The main resource is | 49 // Main resource loading is different for workers. The main resource is |
| 49 // loaded by the worker using WorkerScriptLoader. | 50 // loaded by the worker using WorkerScriptLoader. |
| 50 // These overrides are stubbed out. | 51 // These overrides are stubbed out. |
| 51 void willStartMainResourceRequest( | 52 void willStartMainResourceRequest( |
| 52 blink::WebURLRequest&, | 53 blink::WebURLRequest&, |
| 53 const blink::WebApplicationCacheHost*) override {} | 54 const blink::WebApplicationCacheHost*) override {} |
| 54 void didReceiveResponseForMainResource( | 55 void didReceiveResponseForMainResource( |
| 55 const blink::WebURLResponse&) override {} | 56 const blink::WebURLResponse&) override {} |
| 56 void didReceiveDataForMainResource(const char* data, unsigned len) override {} | 57 void didReceiveDataForMainResource(const char* data, unsigned len) override {} |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 } | 312 } |
| 312 } | 313 } |
| 313 | 314 |
| 314 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { | 315 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { |
| 315 // After this we wouldn't get any IPC for this stub. | 316 // After this we wouldn't get any IPC for this stub. |
| 316 running_ = false; | 317 running_ = false; |
| 317 impl_->terminateWorkerContext(); | 318 impl_->terminateWorkerContext(); |
| 318 } | 319 } |
| 319 | 320 |
| 320 } // namespace content | 321 } // namespace content |
| OLD | NEW |