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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 virtual void workerContextDestroyed(); | 57 virtual void workerContextDestroyed(); |
58 virtual void didHandleInstallEvent(int request_id); | 58 virtual void didHandleInstallEvent(int request_id); |
59 virtual void didHandleFetchEvent(int request_id); | 59 virtual void didHandleFetchEvent(int request_id); |
60 virtual void didHandleFetchEvent( | 60 virtual void didHandleFetchEvent( |
61 int request_id, | 61 int request_id, |
62 const blink::WebServiceWorkerResponse& response); | 62 const blink::WebServiceWorkerResponse& response); |
63 | 63 |
64 // TODO: Implement DevTools related method overrides. | 64 // TODO: Implement DevTools related method overrides. |
65 | 65 |
66 int embedded_worker_id() const { return embedded_worker_id_; } | 66 int embedded_worker_id() const { return embedded_worker_id_; } |
| 67 base::MessageLoopProxy* main_thread_proxy() const { |
| 68 return main_thread_proxy_; |
| 69 } |
67 | 70 |
68 private: | 71 private: |
69 void OnSendMessageToWorker(int thread_id, | 72 void OnSendMessageToWorker(int thread_id, |
70 int embedded_worker_id, | 73 int embedded_worker_id, |
71 int request_id, | 74 int request_id, |
72 const IPC::Message& message); | 75 const IPC::Message& message); |
73 void SendWorkerStarted(); | 76 void SendWorkerStarted(); |
74 | 77 |
75 const int embedded_worker_id_; | 78 const int embedded_worker_id_; |
76 const int64 service_worker_version_id_; | 79 const int64 service_worker_version_id_; |
77 const GURL script_url_; | 80 const GURL script_url_; |
78 scoped_refptr<ThreadSafeSender> sender_; | 81 scoped_refptr<ThreadSafeSender> sender_; |
79 scoped_refptr<base::MessageLoopProxy> main_thread_proxy_; | 82 scoped_refptr<base::MessageLoopProxy> main_thread_proxy_; |
80 scoped_refptr<base::TaskRunner> worker_task_runner_; | 83 scoped_refptr<base::TaskRunner> worker_task_runner_; |
81 | 84 |
82 scoped_ptr<ServiceWorkerScriptContext> script_context_; | 85 scoped_ptr<ServiceWorkerScriptContext> script_context_; |
83 | 86 |
84 base::WeakPtrFactory<EmbeddedWorkerContextClient> weak_factory_; | 87 base::WeakPtrFactory<EmbeddedWorkerContextClient> weak_factory_; |
85 | 88 |
86 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerContextClient); | 89 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerContextClient); |
87 }; | 90 }; |
88 | 91 |
89 } // namespace content | 92 } // namespace content |
90 | 93 |
91 #endif // CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_CLIENT_H_ | 94 #endif // CONTENT_CHILD_SERVICE_WORKER_EMBEDDED_WORKER_CLIENT_H_ |
OLD | NEW |