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

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

Issue 2638313002: Manage ServiceWorkerDispatcherHost in ServiceWorkerContextCore (Closed)
Patch Set: Rebase 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 22 matching lines...) Expand all
33 class InterfaceRegistry; 33 class InterfaceRegistry;
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 MockRenderProcessHost; 40 class MockRenderProcessHost;
41 class ServiceWorkerContextCore; 41 class ServiceWorkerContextCore;
42 class ServiceWorkerContextWrapper; 42 class ServiceWorkerContextWrapper;
43 class ServiceWorkerDispatcherHost;
43 class TestBrowserContext; 44 class TestBrowserContext;
44 struct EmbeddedWorkerStartParams; 45 struct EmbeddedWorkerStartParams;
45 struct PlatformNotificationData; 46 struct PlatformNotificationData;
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
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 IPC::TestSink inner_sink_; 291 IPC::TestSink inner_sink_;
291 292
292 std::vector<std::unique_ptr<MockEmbeddedWorkerInstanceClient>> 293 std::vector<std::unique_ptr<MockEmbeddedWorkerInstanceClient>>
293 mock_instance_clients_; 294 mock_instance_clients_;
294 size_t mock_instance_clients_next_index_; 295 size_t mock_instance_clients_next_index_;
295 296
296 int next_thread_id_; 297 int next_thread_id_;
297 int mock_render_process_id_; 298 int mock_render_process_id_;
298 int new_mock_render_process_id_; 299 int new_mock_render_process_id_;
299 300
301 std::map<int /* process_id */, scoped_refptr<ServiceWorkerDispatcherHost>>
302 dispatcher_hosts_;
303
300 std::unique_ptr<service_manager::InterfaceRegistry> 304 std::unique_ptr<service_manager::InterfaceRegistry>
301 render_process_interface_registry_; 305 render_process_interface_registry_;
302 std::unique_ptr<service_manager::InterfaceRegistry> 306 std::unique_ptr<service_manager::InterfaceRegistry>
303 new_render_process_interface_registry_; 307 new_render_process_interface_registry_;
304 308
305 std::map<int, int64_t> embedded_worker_id_service_worker_version_id_map_; 309 std::map<int, int64_t> embedded_worker_id_service_worker_version_id_map_;
306 std::map<int /* thread_id */, int /* embedded_worker_id */> 310 std::map<int /* thread_id */, int /* embedded_worker_id */>
307 thread_id_embedded_worker_id_map_; 311 thread_id_embedded_worker_id_map_;
308 312
309 // Updated each time MessageToWorker message is received. 313 // Updated each time MessageToWorker message is received.
(...skipping 12 matching lines...) Expand all
322 std::unique_ptr<MockType> mock = 326 std::unique_ptr<MockType> mock =
323 base::MakeUnique<MockType>(std::forward<Args>(args)...); 327 base::MakeUnique<MockType>(std::forward<Args>(args)...);
324 MockType* mock_rawptr = mock.get(); 328 MockType* mock_rawptr = mock.get();
325 RegisterMockInstanceClient(std::move(mock)); 329 RegisterMockInstanceClient(std::move(mock));
326 return mock_rawptr; 330 return mock_rawptr;
327 } 331 }
328 332
329 } // namespace content 333 } // namespace content
330 334
331 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ 335 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698