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_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 struct EmbeddedWorkerMsg_StartWorker_Params; | 24 struct EmbeddedWorkerMsg_StartWorker_Params; |
25 | 25 |
26 namespace IPC { | 26 namespace IPC { |
27 class Message; | 27 class Message; |
28 } | 28 } |
29 | 29 |
30 namespace content { | 30 namespace content { |
31 | 31 |
32 class EmbeddedWorkerRegistry; | 32 class EmbeddedWorkerRegistry; |
| 33 class MessagePortMessageFilter; |
33 class ServiceWorkerContextCore; | 34 class ServiceWorkerContextCore; |
34 struct ServiceWorkerFetchRequest; | 35 struct ServiceWorkerFetchRequest; |
35 | 36 |
36 // This gives an interface to control one EmbeddedWorker instance, which | 37 // This gives an interface to control one EmbeddedWorker instance, which |
37 // may be 'in-waiting' or running in one of the child processes added by | 38 // may be 'in-waiting' or running in one of the child processes added by |
38 // AddProcessReference(). | 39 // AddProcessReference(). |
39 class CONTENT_EXPORT EmbeddedWorkerInstance { | 40 class CONTENT_EXPORT EmbeddedWorkerInstance { |
40 public: | 41 public: |
41 typedef base::Callback<void(ServiceWorkerStatusCode)> StatusCallback; | 42 typedef base::Callback<void(ServiceWorkerStatusCode)> StatusCallback; |
42 enum Status { | 43 enum Status { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 92 |
92 void ResumeAfterDownload(); | 93 void ResumeAfterDownload(); |
93 | 94 |
94 int embedded_worker_id() const { return embedded_worker_id_; } | 95 int embedded_worker_id() const { return embedded_worker_id_; } |
95 Status status() const { return status_; } | 96 Status status() const { return status_; } |
96 int process_id() const { return process_id_; } | 97 int process_id() const { return process_id_; } |
97 int thread_id() const { return thread_id_; } | 98 int thread_id() const { return thread_id_; } |
98 int worker_devtools_agent_route_id() const { | 99 int worker_devtools_agent_route_id() const { |
99 return worker_devtools_agent_route_id_; | 100 return worker_devtools_agent_route_id_; |
100 } | 101 } |
| 102 MessagePortMessageFilter* message_port_message_filter() const; |
101 | 103 |
102 void AddListener(Listener* listener); | 104 void AddListener(Listener* listener); |
103 void RemoveListener(Listener* listener); | 105 void RemoveListener(Listener* listener); |
104 | 106 |
105 private: | 107 private: |
106 typedef ObserverList<Listener> ListenerList; | 108 typedef ObserverList<Listener> ListenerList; |
107 | 109 |
108 friend class EmbeddedWorkerRegistry; | 110 friend class EmbeddedWorkerRegistry; |
109 FRIEND_TEST_ALL_PREFIXES(EmbeddedWorkerInstanceTest, StartAndStop); | 111 FRIEND_TEST_ALL_PREFIXES(EmbeddedWorkerInstanceTest, StartAndStop); |
110 | 112 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 ListenerList listener_list_; | 197 ListenerList listener_list_; |
196 | 198 |
197 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; | 199 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; |
198 | 200 |
199 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); | 201 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); |
200 }; | 202 }; |
201 | 203 |
202 } // namespace content | 204 } // namespace content |
203 | 205 |
204 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ | 206 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ |
OLD | NEW |