| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_CLIENT_H_ | 5 #ifndef CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_CLIENT_H_ |
| 6 #define CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_CLIENT_H_ | 6 #define CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 bool OnMessageReceived(const IPC::Message& msg); | 48 bool OnMessageReceived(const IPC::Message& msg); |
| 49 | 49 |
| 50 void SendMessageToBrowser(int request_id, const IPC::Message& message); | 50 void SendMessageToBrowser(int request_id, const IPC::Message& message); |
| 51 | 51 |
| 52 // WebServiceWorkerContextClient overrides, some of them are just dispatched | 52 // WebServiceWorkerContextClient overrides, some of them are just dispatched |
| 53 // on to script_context_. | 53 // on to script_context_. |
| 54 virtual void workerContextFailedToStart(); | 54 virtual void workerContextFailedToStart(); |
| 55 virtual void workerContextStarted(blink::WebServiceWorkerContextProxy* proxy); | 55 virtual void workerContextStarted(blink::WebServiceWorkerContextProxy* proxy); |
| 56 virtual void workerContextDestroyed(); | 56 virtual void workerContextDestroyed(); |
| 57 virtual void didHandleInstallEvent(int request_id); | 57 virtual void didHandleInstallEvent(int request_id); |
| 58 virtual void didHandleFetchEvent(int request_id); |
| 58 | 59 |
| 59 // TODO: Implement DevTools related method overrides. | 60 // TODO: Implement DevTools related method overrides. |
| 60 | 61 |
| 61 int embedded_worker_id() const { return embedded_worker_id_; } | 62 int embedded_worker_id() const { return embedded_worker_id_; } |
| 62 | 63 |
| 63 private: | 64 private: |
| 64 void OnSendMessageToWorker(int thread_id, | 65 void OnSendMessageToWorker(int thread_id, |
| 65 int embedded_worker_id, | 66 int embedded_worker_id, |
| 66 int request_id, | 67 int request_id, |
| 67 const IPC::Message& message); | 68 const IPC::Message& message); |
| 68 void SendWorkerStarted(); | 69 void SendWorkerStarted(); |
| 69 | 70 |
| 70 const int embedded_worker_id_; | 71 const int embedded_worker_id_; |
| 71 const int64 service_worker_version_id_; | 72 const int64 service_worker_version_id_; |
| 72 const GURL script_url_; | 73 const GURL script_url_; |
| 73 scoped_refptr<ThreadSafeSender> sender_; | 74 scoped_refptr<ThreadSafeSender> sender_; |
| 74 scoped_refptr<base::MessageLoopProxy> main_thread_proxy_; | 75 scoped_refptr<base::MessageLoopProxy> main_thread_proxy_; |
| 75 scoped_refptr<base::TaskRunner> worker_task_runner_; | 76 scoped_refptr<base::TaskRunner> worker_task_runner_; |
| 76 | 77 |
| 77 scoped_ptr<ServiceWorkerScriptContext> script_context_; | 78 scoped_ptr<ServiceWorkerScriptContext> script_context_; |
| 78 | 79 |
| 79 base::WeakPtrFactory<EmbeddedWorkerContextClient> weak_factory_; | 80 base::WeakPtrFactory<EmbeddedWorkerContextClient> weak_factory_; |
| 80 | 81 |
| 81 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerContextClient); | 82 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerContextClient); |
| 82 }; | 83 }; |
| 83 | 84 |
| 84 } // namespace content | 85 } // namespace content |
| 85 | 86 |
| 86 #endif // CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_CLIENT_H_ | 87 #endif // CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_CLIENT_H_ |
| OLD | NEW |