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_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_DISPATCHER_H_ |
6 #define CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_DISPATCHER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 std::unique_ptr<EmbeddedWorkerDevToolsAgent> dev_tools_agent_; | 59 std::unique_ptr<EmbeddedWorkerDevToolsAgent> dev_tools_agent_; |
60 }; | 60 }; |
61 | 61 |
62 void OnStartWorker(const EmbeddedWorkerMsg_StartWorker_Params& params); | 62 void OnStartWorker(const EmbeddedWorkerMsg_StartWorker_Params& params); |
63 void OnStopWorker(int embedded_worker_id); | 63 void OnStopWorker(int embedded_worker_id); |
64 void OnResumeAfterDownload(int embedded_worker_id); | 64 void OnResumeAfterDownload(int embedded_worker_id); |
65 void OnAddMessageToConsole(int embedded_worker_id, | 65 void OnAddMessageToConsole(int embedded_worker_id, |
66 ConsoleMessageLevel level, | 66 ConsoleMessageLevel level, |
67 const std::string& message); | 67 const std::string& message); |
68 | 68 |
| 69 // These methods are used by EmbeddedWorkerInstanceClientImpl to keep |
| 70 // consistency between chromium IPC and mojo IPC. |
| 71 // TODO(shimazu): Remove them after all messages for EmbeddedWorker are |
| 72 // replaced by mojo IPC. (Tracking issue: https://crbug.com/629701) |
69 void RegisterWorker(int embedded_worker_id, | 73 void RegisterWorker(int embedded_worker_id, |
70 std::unique_ptr<WorkerWrapper> wrapper); | 74 std::unique_ptr<WorkerWrapper> wrapper); |
| 75 void UnregisterWorker(int embedded_worker_id); |
| 76 // Return false if no worker found |
| 77 bool SetStopWorkerTimer(int embedded_worker_id); |
71 | 78 |
72 IDMap<WorkerWrapper, IDMapOwnPointer> workers_; | 79 IDMap<WorkerWrapper, IDMapOwnPointer> workers_; |
73 std::map<int /* embedded_worker_id */, base::TimeTicks> stop_worker_times_; | 80 std::map<int /* embedded_worker_id */, base::TimeTicks> stop_worker_times_; |
74 base::WeakPtrFactory<EmbeddedWorkerDispatcher> weak_factory_; | 81 base::WeakPtrFactory<EmbeddedWorkerDispatcher> weak_factory_; |
75 | 82 |
76 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerDispatcher); | 83 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerDispatcher); |
77 }; | 84 }; |
78 | 85 |
79 } // namespace content | 86 } // namespace content |
80 | 87 |
81 #endif // CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_DISPATCHER_H_ | 88 #endif // CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_DISPATCHER_H_ |
OLD | NEW |