Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(648)

Side by Side Diff: content/renderer/service_worker/embedded_worker_dispatcher.h

Issue 2307543002: ServiceWorker: Mojofication of EWInstance::StopWorker (Closed)
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 std::unique_ptr<EmbeddedWorkerDevToolsAgent> dev_tools_agent_; 60 std::unique_ptr<EmbeddedWorkerDevToolsAgent> dev_tools_agent_;
61 }; 61 };
62 62
63 void OnStartWorker(const EmbeddedWorkerStartParams& params); 63 void OnStartWorker(const EmbeddedWorkerStartParams& params);
64 void OnStopWorker(int embedded_worker_id); 64 void OnStopWorker(int embedded_worker_id);
65 void OnResumeAfterDownload(int embedded_worker_id); 65 void OnResumeAfterDownload(int embedded_worker_id);
66 void OnAddMessageToConsole(int embedded_worker_id, 66 void OnAddMessageToConsole(int embedded_worker_id,
67 ConsoleMessageLevel level, 67 ConsoleMessageLevel level,
68 const std::string& message); 68 const std::string& message);
69 69
70 // These methods are used by EmbeddedWorkerInstanceClientImpl to keep
71 // consistency between chromium IPC and mojo IPC.
72 // TODO(shimazu): Remove them after all messages for EmbeddedWorker are
73 // replaced by mojo IPC. (Tracking issue: https://crbug.com/629701)
70 std::unique_ptr<WorkerWrapper> StartWorkerContext( 74 std::unique_ptr<WorkerWrapper> StartWorkerContext(
71 const EmbeddedWorkerStartParams& params, 75 const EmbeddedWorkerStartParams& params,
72 std::unique_ptr<ServiceWorkerContextClient> context_client); 76 std::unique_ptr<ServiceWorkerContextClient> context_client);
73 void RegisterWorker(int embedded_worker_id, 77 void RegisterWorker(int embedded_worker_id,
74 std::unique_ptr<WorkerWrapper> wrapper); 78 std::unique_ptr<WorkerWrapper> wrapper);
79 void UnregisterWorker(int embedded_worker_id);
80 // Return false if no worker found
81 bool SetStopWorkerTimer(int embedded_worker_id);
horo 2016/09/13 08:25:33 It doesn't set a timer. RecordStopWorkerTime is b
shimazu 2016/09/20 04:56:20 Done.
75 82
76 IDMap<WorkerWrapper, IDMapOwnPointer> workers_; 83 IDMap<WorkerWrapper, IDMapOwnPointer> workers_;
77 std::map<int /* embedded_worker_id */, base::TimeTicks> stop_worker_times_; 84 std::map<int /* embedded_worker_id */, base::TimeTicks> stop_worker_times_;
78 base::WeakPtrFactory<EmbeddedWorkerDispatcher> weak_factory_; 85 base::WeakPtrFactory<EmbeddedWorkerDispatcher> weak_factory_;
79 86
80 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerDispatcher); 87 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerDispatcher);
81 }; 88 };
82 89
83 } // namespace content 90 } // namespace content
84 91
85 #endif // CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_DISPATCHER_H_ 92 #endif // CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698