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

Side by Side Diff: content/browser/service_worker/embedded_worker_test_helper.h

Issue 2638313002: Manage ServiceWorkerDispatcherHost in ServiceWorkerContextCore (Closed)
Patch Set: Remove a break line Created 3 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_TEST_HELPER_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 namespace content { 36 namespace content {
37 37
38 class EmbeddedWorkerRegistry; 38 class EmbeddedWorkerRegistry;
39 class EmbeddedWorkerTestHelper; 39 class EmbeddedWorkerTestHelper;
40 class MessagePortMessageFilter; 40 class MessagePortMessageFilter;
41 class MockRenderProcessHost; 41 class MockRenderProcessHost;
42 class ServiceWorkerContextCore; 42 class ServiceWorkerContextCore;
43 class ServiceWorkerContextWrapper; 43 class ServiceWorkerContextWrapper;
44 class ServiceWorkerDispatcherHost;
44 class TestBrowserContext; 45 class TestBrowserContext;
45 struct EmbeddedWorkerStartParams; 46 struct EmbeddedWorkerStartParams;
46 struct PushEventPayload; 47 struct PushEventPayload;
47 struct ServiceWorkerFetchRequest; 48 struct ServiceWorkerFetchRequest;
48 49
49 // In-Process EmbeddedWorker test helper. 50 // In-Process EmbeddedWorker test helper.
50 // 51 //
51 // Usage: create an instance of this class to test browser-side embedded worker 52 // Usage: create an instance of this class to test browser-side embedded worker
52 // code without creating a child process. This class will create a 53 // code without creating a child process. This class will create a
53 // ServiceWorkerContextWrapper and ServiceWorkerContextCore for you. 54 // ServiceWorkerContextWrapper and ServiceWorkerContextCore for you.
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 IPC::TestSink inner_sink_; 262 IPC::TestSink inner_sink_;
262 263
263 std::vector<std::unique_ptr<MockEmbeddedWorkerInstanceClient>> 264 std::vector<std::unique_ptr<MockEmbeddedWorkerInstanceClient>>
264 mock_instance_clients_; 265 mock_instance_clients_;
265 size_t mock_instance_clients_next_index_; 266 size_t mock_instance_clients_next_index_;
266 267
267 int next_thread_id_; 268 int next_thread_id_;
268 int mock_render_process_id_; 269 int mock_render_process_id_;
269 int new_mock_render_process_id_; 270 int new_mock_render_process_id_;
270 271
272 std::map<int, scoped_refptr<ServiceWorkerDispatcherHost>> dispatcher_hosts_;
falken 2017/02/08 06:53:51 Can you comment what int is, like line 280 does?
shimazu 2017/02/13 03:25:56 Done.
273
271 std::unique_ptr<service_manager::InterfaceRegistry> 274 std::unique_ptr<service_manager::InterfaceRegistry>
272 render_process_interface_registry_; 275 render_process_interface_registry_;
273 std::unique_ptr<service_manager::InterfaceRegistry> 276 std::unique_ptr<service_manager::InterfaceRegistry>
274 new_render_process_interface_registry_; 277 new_render_process_interface_registry_;
275 278
276 std::map<int, int64_t> embedded_worker_id_service_worker_version_id_map_; 279 std::map<int, int64_t> embedded_worker_id_service_worker_version_id_map_;
277 std::map<int /* thread_id */, int /* embedded_worker_id */> 280 std::map<int /* thread_id */, int /* embedded_worker_id */>
278 thread_id_embedded_worker_id_map_; 281 thread_id_embedded_worker_id_map_;
279 282
280 // Updated each time MessageToWorker message is received. 283 // Updated each time MessageToWorker message is received.
(...skipping 13 matching lines...) Expand all
294 std::unique_ptr<MockType> mock = 297 std::unique_ptr<MockType> mock =
295 base::MakeUnique<MockType>(std::forward<Args>(args)...); 298 base::MakeUnique<MockType>(std::forward<Args>(args)...);
296 MockType* mock_rawptr = mock.get(); 299 MockType* mock_rawptr = mock.get();
297 RegisterMockInstanceClient(std::move(mock)); 300 RegisterMockInstanceClient(std::move(mock));
298 return mock_rawptr; 301 return mock_rawptr;
299 } 302 }
300 303
301 } // namespace content 304 } // namespace content
302 305
303 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ 306 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698