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