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

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

Issue 2630273002: ServiceWorker: mojofy ResumeAfterDownload and AddMessageToConsole (Closed)
Patch Set: Added a comment Created 3 years, 11 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
11 #include "base/id_map.h" 11 #include "base/id_map.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/time/time.h" 14 #include "base/time/time.h"
15 #include "content/child/scoped_child_process_reference.h" 15 #include "content/child/scoped_child_process_reference.h"
16 #include "content/public/common/console_message_level.h"
17 #include "ipc/ipc_listener.h" 16 #include "ipc/ipc_listener.h"
18 17
19 namespace blink { 18 namespace blink {
20 19
21 class WebEmbeddedWorker; 20 class WebEmbeddedWorker;
22 21
23 } // namespace blink 22 } // namespace blink
24 23
25 namespace content { 24 namespace content {
26 25
(...skipping 25 matching lines...) Expand all
52 51
53 blink::WebEmbeddedWorker* worker() { return worker_.get(); } 52 blink::WebEmbeddedWorker* worker() { return worker_.get(); }
54 53
55 private: 54 private:
56 ScopedChildProcessReference process_ref_; 55 ScopedChildProcessReference process_ref_;
57 std::unique_ptr<blink::WebEmbeddedWorker> worker_; 56 std::unique_ptr<blink::WebEmbeddedWorker> worker_;
58 std::unique_ptr<EmbeddedWorkerDevToolsAgent> dev_tools_agent_; 57 std::unique_ptr<EmbeddedWorkerDevToolsAgent> dev_tools_agent_;
59 }; 58 };
60 59
61 void OnStopWorker(int embedded_worker_id); 60 void OnStopWorker(int embedded_worker_id);
62 void OnResumeAfterDownload(int embedded_worker_id);
63 void OnAddMessageToConsole(int embedded_worker_id,
64 ConsoleMessageLevel level,
65 const std::string& message);
66 61
67 std::unique_ptr<WorkerWrapper> StartWorkerContext( 62 std::unique_ptr<WorkerWrapper> StartWorkerContext(
68 const EmbeddedWorkerStartParams& params, 63 const EmbeddedWorkerStartParams& params,
69 std::unique_ptr<ServiceWorkerContextClient> context_client); 64 std::unique_ptr<ServiceWorkerContextClient> context_client);
70 65
71 // These methods are used by EmbeddedWorkerInstanceClientImpl to keep 66 // These methods are used by EmbeddedWorkerInstanceClientImpl to keep
72 // consistency between chromium IPC and mojo IPC. 67 // consistency between chromium IPC and mojo IPC.
73 // TODO(shimazu): Remove them after all messages for EmbeddedWorker are 68 // TODO(shimazu): Remove them after all messages for EmbeddedWorker are
74 // replaced by mojo IPC. (Tracking issue: https://crbug.com/629701) 69 // replaced by mojo IPC. (Tracking issue: https://crbug.com/629701)
75 void RegisterWorker(int embedded_worker_id, 70 void RegisterWorker(int embedded_worker_id,
76 std::unique_ptr<WorkerWrapper> wrapper); 71 std::unique_ptr<WorkerWrapper> wrapper);
77 void UnregisterWorker(int embedded_worker_id); 72 void UnregisterWorker(int embedded_worker_id);
78 void RecordStopWorkerTimer(int embedded_worker_id); 73 void RecordStopWorkerTimer(int embedded_worker_id);
79 74
80 IDMap<std::unique_ptr<WorkerWrapper>> workers_; 75 IDMap<std::unique_ptr<WorkerWrapper>> workers_;
81 std::map<int /* embedded_worker_id */, base::TimeTicks> stop_worker_times_; 76 std::map<int /* embedded_worker_id */, base::TimeTicks> stop_worker_times_;
82 base::WeakPtrFactory<EmbeddedWorkerDispatcher> weak_factory_; 77 base::WeakPtrFactory<EmbeddedWorkerDispatcher> weak_factory_;
83 78
84 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerDispatcher); 79 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerDispatcher);
85 }; 80 };
86 81
87 } // namespace content 82 } // namespace content
88 83
89 #endif // CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_DISPATCHER_H_ 84 #endif // CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698