OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
| 6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 |
| 10 namespace blink { |
| 11 class WebServiceWorkerContextProxy; |
| 12 } |
| 13 |
| 14 namespace IPC { |
| 15 class Message; |
| 16 } |
| 17 |
| 18 namespace content { |
| 19 |
| 20 class EmbeddedWorkerContextClient; |
| 21 struct ServiceWorkerFetchRequest; |
| 22 |
| 23 // TODO(kinuko): This should implement WebServiceWorkerContextClient |
| 24 // rather than having EmbeddedWorkerContextClient implement it. |
| 25 // See the header comment in embedded_worker_context_client.h for the |
| 26 // potential EW/SW layering concerns. |
| 27 class ServiceWorkerScriptContext { |
| 28 public: |
| 29 ServiceWorkerScriptContext( |
| 30 EmbeddedWorkerContextClient* embedded_context, |
| 31 blink::WebServiceWorkerContextProxy* proxy); |
| 32 ~ServiceWorkerScriptContext(); |
| 33 |
| 34 void OnMessageReceived(const IPC::Message& message); |
| 35 |
| 36 private: |
| 37 // Send message back to the browser. |
| 38 void Send(const IPC::Message& message); |
| 39 |
| 40 void OnFetchEvent(const ServiceWorkerFetchRequest& request); |
| 41 |
| 42 // Not owned; embedded_context_ owns this. |
| 43 EmbeddedWorkerContextClient* embedded_context_; |
| 44 |
| 45 // Not owned; this object is destroyed when proxy_ becomes invalid. |
| 46 blink::WebServiceWorkerContextProxy* proxy_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); |
| 49 }; |
| 50 |
| 51 } // namespace content |
| 52 |
| 53 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
OLD | NEW |