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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // listener. (TODO(kinuko): consider using IPC::Listener interface) | 88 // listener. (TODO(kinuko): consider using IPC::Listener interface) |
89 // TODO(kinuko): Deprecate OnReplyReceived. | 89 // TODO(kinuko): Deprecate OnReplyReceived. |
90 virtual bool OnMessageReceived(const IPC::Message& message) = 0; | 90 virtual bool OnMessageReceived(const IPC::Message& message) = 0; |
91 }; | 91 }; |
92 | 92 |
93 ~EmbeddedWorkerInstance(); | 93 ~EmbeddedWorkerInstance(); |
94 | 94 |
95 // Starts the worker. It is invalid to call this when the worker is not in | 95 // Starts the worker. It is invalid to call this when the worker is not in |
96 // STOPPED status. |callback| is invoked after the worker script has been | 96 // STOPPED status. |callback| is invoked after the worker script has been |
97 // started and evaluated, or when an error occurs. | 97 // started and evaluated, or when an error occurs. |
98 void Start(int64 service_worker_version_id, | 98 void Start(std::string service_worker_version_uuid, |
99 const GURL& scope, | 99 const GURL& scope, |
100 const GURL& script_url, | 100 const GURL& script_url, |
101 bool pause_after_download, | 101 bool pause_after_download, |
102 const StatusCallback& callback); | 102 const StatusCallback& callback); |
103 | 103 |
104 // Stops the worker. It is invalid to call this when the worker is | 104 // Stops the worker. It is invalid to call this when the worker is |
105 // not in STARTING or RUNNING status. | 105 // not in STARTING or RUNNING status. |
106 // This returns false if stopping a worker fails immediately, e.g. when | 106 // This returns false if stopping a worker fails immediately, e.g. when |
107 // IPC couldn't be sent to the worker. | 107 // IPC couldn't be sent to the worker. |
108 ServiceWorkerStatusCode Stop(); | 108 ServiceWorkerStatusCode Stop(); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 base::TimeTicks start_timing_; | 248 base::TimeTicks start_timing_; |
249 | 249 |
250 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; | 250 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; |
251 | 251 |
252 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); | 252 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); |
253 }; | 253 }; |
254 | 254 |
255 } // namespace content | 255 } // namespace content |
256 | 256 |
257 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ | 257 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ |
OLD | NEW |