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_REGISTRY_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const base::WeakPtr<ServiceWorkerContextCore>& context, | 49 const base::WeakPtr<ServiceWorkerContextCore>& context, |
50 EmbeddedWorkerRegistry* old_registry); | 50 EmbeddedWorkerRegistry* old_registry); |
51 | 51 |
52 bool OnMessageReceived(const IPC::Message& message); | 52 bool OnMessageReceived(const IPC::Message& message); |
53 | 53 |
54 // Creates and removes a new worker instance entry for bookkeeping. | 54 // Creates and removes a new worker instance entry for bookkeeping. |
55 // This doesn't actually start or stop the worker. | 55 // This doesn't actually start or stop the worker. |
56 scoped_ptr<EmbeddedWorkerInstance> CreateWorker(); | 56 scoped_ptr<EmbeddedWorkerInstance> CreateWorker(); |
57 | 57 |
58 // Called from EmbeddedWorkerInstance, relayed to the child process. | 58 // Called from EmbeddedWorkerInstance, relayed to the child process. |
59 void SendStartWorker(scoped_ptr<EmbeddedWorkerMsg_StartWorker_Params> params, | 59 ServiceWorkerStatusCode SendStartWorker( |
60 const StatusCallback& callback, | 60 scoped_ptr<EmbeddedWorkerMsg_StartWorker_Params> params, |
61 int process_id); | 61 int process_id); |
62 ServiceWorkerStatusCode StopWorker(int process_id, | 62 ServiceWorkerStatusCode StopWorker(int process_id, |
63 int embedded_worker_id); | 63 int embedded_worker_id); |
64 | 64 |
65 // Stop all active workers, even if they're handling events. | 65 // Stop all active workers, even if they're handling events. |
66 void Shutdown(); | 66 void Shutdown(); |
67 | 67 |
68 // Called back from EmbeddedWorker in the child process, relayed via | 68 // Called back from EmbeddedWorker in the child process, relayed via |
69 // ServiceWorkerDispatcherHost. | 69 // ServiceWorkerDispatcherHost. |
70 void OnWorkerReadyForInspection(int process_id, int embedded_worker_id); | 70 void OnWorkerReadyForInspection(int process_id, int embedded_worker_id); |
71 void OnWorkerScriptLoaded(int process_id, | 71 void OnWorkerScriptLoaded(int process_id, |
72 int thread_id, | 72 int thread_id, |
73 int embedded_worker_id); | 73 int embedded_worker_id); |
74 void OnWorkerScriptLoadFailed(int process_id, int embedded_worker_id); | 74 void OnWorkerScriptLoadFailed(int process_id, int embedded_worker_id); |
| 75 void OnWorkerScriptEvaluated(int process_id, |
| 76 int embedded_worker_id, |
| 77 bool success); |
75 void OnWorkerStarted(int process_id, int embedded_worker_id); | 78 void OnWorkerStarted(int process_id, int embedded_worker_id); |
76 void OnWorkerStopped(int process_id, int embedded_worker_id); | 79 void OnWorkerStopped(int process_id, int embedded_worker_id); |
77 void OnPausedAfterDownload(int process_id, int embedded_worker_id); | 80 void OnPausedAfterDownload(int process_id, int embedded_worker_id); |
78 void OnReportException(int embedded_worker_id, | 81 void OnReportException(int embedded_worker_id, |
79 const base::string16& error_message, | 82 const base::string16& error_message, |
80 int line_number, | 83 int line_number, |
81 int column_number, | 84 int column_number, |
82 const GURL& source_url); | 85 const GURL& source_url); |
83 void OnReportConsoleMessage(int embedded_worker_id, | 86 void OnReportConsoleMessage(int embedded_worker_id, |
84 int source_identifier, | 87 int source_identifier, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 129 |
127 int next_embedded_worker_id_; | 130 int next_embedded_worker_id_; |
128 const int initial_embedded_worker_id_; | 131 const int initial_embedded_worker_id_; |
129 | 132 |
130 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerRegistry); | 133 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerRegistry); |
131 }; | 134 }; |
132 | 135 |
133 } // namespace content | 136 } // namespace content |
134 | 137 |
135 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ | 138 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ |
OLD | NEW |