Chromium Code Reviews| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 | 221 |
| 222 // Called back from StartTask after a start worker message is sent. | 222 // Called back from StartTask after a start worker message is sent. |
| 223 void OnStartWorkerMessageSent(); | 223 void OnStartWorkerMessageSent(); |
| 224 | 224 |
| 225 // Implements mojom::EmbeddedWorkerInstanceHost. | 225 // Implements mojom::EmbeddedWorkerInstanceHost. |
| 226 // These functions all run on the IO thread. | 226 // These functions all run on the IO thread. |
| 227 void OnReadyForInspection() override; | 227 void OnReadyForInspection() override; |
| 228 void OnScriptLoaded() override; | 228 void OnScriptLoaded() override; |
| 229 // Notifies the corresponding provider host that the thread has started and is | 229 // Notifies the corresponding provider host that the thread has started and is |
| 230 // ready to receive messages. | 230 // ready to receive messages. |
| 231 void OnThreadStarted(int thread_id, int provider_id) override; | 231 void OnThreadStarted(int thread_id) override; |
| 232 void OnScriptLoadFailed() override; | 232 void OnScriptLoadFailed() override; |
| 233 // Fires the callback passed to Start(). | 233 // Fires the callback passed to Start(). |
| 234 void OnScriptEvaluated(bool success) override; | 234 void OnScriptEvaluated(bool success) override; |
| 235 // Changes the internal worker status from STARTING to RUNNING. | 235 // Changes the internal worker status from STARTING to RUNNING. |
| 236 void OnStarted() override; | 236 void OnStarted() override; |
| 237 // Resets the embedded worker instance to the initial state. This will change | 237 // Resets the embedded worker instance to the initial state. This will change |
| 238 // the internal status from STARTING or RUNNING to STOPPED. | 238 // the internal status from STARTING or RUNNING to STOPPED. |
| 239 void OnStopped() override; | 239 void OnStopped() override; |
| 240 void OnReportException(const base::string16& error_message, | 240 void OnReportException(const base::string16& error_message, |
| 241 int line_number, | 241 int line_number, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 const int embedded_worker_id_; | 276 const int embedded_worker_id_; |
| 277 | 277 |
| 278 EmbeddedWorkerStatus status_; | 278 EmbeddedWorkerStatus status_; |
| 279 StartingPhase starting_phase_; | 279 StartingPhase starting_phase_; |
| 280 int restart_count_; | 280 int restart_count_; |
| 281 | 281 |
| 282 // Current running information. | 282 // Current running information. |
| 283 std::unique_ptr<EmbeddedWorkerInstance::WorkerProcessHandle> process_handle_; | 283 std::unique_ptr<EmbeddedWorkerInstance::WorkerProcessHandle> process_handle_; |
| 284 int thread_id_; | 284 int thread_id_; |
| 285 | 285 |
| 286 // |client_| is used to send messages to the renderer process. | 286 // |client_| is used to send messages to the renderer process. This should not |
| 287 // disconnected from the browser side manually because the pipe is possible to | |
| 288 // be used by other associated interfaces before disconnected from the | |
| 289 // renderer side. | |
|
falken
2017/06/06 14:06:33
Not sure I understand. Does this mean the browser
shimazu
2017/06/12 06:08:12
Yes, that's correct. Updated, thanks!
| |
| 287 mojom::EmbeddedWorkerInstanceClientPtr client_; | 290 mojom::EmbeddedWorkerInstanceClientPtr client_; |
| 288 | 291 |
| 289 // Binding for EmbeddedWorkerInstanceHost, runs on IO thread. | 292 // Binding for EmbeddedWorkerInstanceHost, runs on IO thread. |
| 290 mojo::AssociatedBinding<EmbeddedWorkerInstanceHost> instance_host_binding_; | 293 mojo::AssociatedBinding<EmbeddedWorkerInstanceHost> instance_host_binding_; |
| 291 | 294 |
| 292 // TODO(shimazu): Remove this after EmbeddedWorkerStartParams is changed to | 295 // TODO(shimazu): Remove this after EmbeddedWorkerStartParams is changed to |
| 293 // a mojo struct. | 296 // a mojo struct. |
| 294 mojom::ServiceWorkerEventDispatcherRequest pending_dispatcher_request_; | 297 mojom::ServiceWorkerEventDispatcherRequest pending_dispatcher_request_; |
| 295 | 298 |
| 296 // Whether devtools is attached or not. | 299 // Whether devtools is attached or not. |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 313 base::TimeTicks step_time_; | 316 base::TimeTicks step_time_; |
| 314 | 317 |
| 315 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; | 318 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; |
| 316 | 319 |
| 317 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); | 320 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); |
| 318 }; | 321 }; |
| 319 | 322 |
| 320 } // namespace content | 323 } // namespace content |
| 321 | 324 |
| 322 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ | 325 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ |
| OLD | NEW |