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

Side by Side Diff: content/public/test/mock_render_thread.cc

Issue 2820883002: Eliminate ChildThread InterfaceRegistry. (Closed)
Patch Set: . Created 3 years, 7 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
« no previous file with comments | « content/public/test/mock_render_thread.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/public/test/mock_render_thread.h" 5 #include "content/public/test/mock_render_thread.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "content/common/frame_messages.h" 12 #include "content/common/frame_messages.h"
13 #include "content/common/render_message_filter.mojom.h" 13 #include "content/common/render_message_filter.mojom.h"
14 #include "content/common/view_messages.h" 14 #include "content/common/view_messages.h"
15 #include "content/public/renderer/render_thread_observer.h" 15 #include "content/public/renderer/render_thread_observer.h"
16 #include "content/renderer/render_thread_impl.h" 16 #include "content/renderer/render_thread_impl.h"
17 #include "content/renderer/render_view_impl.h" 17 #include "content/renderer/render_view_impl.h"
18 #include "ipc/ipc_message_utils.h" 18 #include "ipc/ipc_message_utils.h"
19 #include "ipc/ipc_sync_message.h" 19 #include "ipc/ipc_sync_message.h"
20 #include "ipc/message_filter.h" 20 #include "ipc/message_filter.h"
21 #include "services/service_manager/public/cpp/connector.h" 21 #include "services/service_manager/public/cpp/connector.h"
22 #include "services/service_manager/public/cpp/interface_provider.h"
23 #include "services/service_manager/public/cpp/interface_registry.h"
24 #include "services/service_manager/public/interfaces/interface_provider_spec.moj om.h"
25 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
26 #include "third_party/WebKit/public/web/WebScriptController.h" 23 #include "third_party/WebKit/public/web/WebScriptController.h"
27 24
28 namespace content { 25 namespace content {
29 26
30 namespace { 27 namespace {
31 28
32 class MockRenderMessageFilterImpl : public mojom::RenderMessageFilter { 29 class MockRenderMessageFilterImpl : public mojom::RenderMessageFilter {
33 public: 30 public:
34 explicit MockRenderMessageFilterImpl(MockRenderThread* thread) 31 explicit MockRenderMessageFilterImpl(MockRenderThread* thread)
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 243
247 void MockRenderThread::ReleaseCachedFonts() { 244 void MockRenderThread::ReleaseCachedFonts() {
248 } 245 }
249 246
250 #endif // OS_WIN 247 #endif // OS_WIN
251 248
252 ServiceManagerConnection* MockRenderThread::GetServiceManagerConnection() { 249 ServiceManagerConnection* MockRenderThread::GetServiceManagerConnection() {
253 return nullptr; 250 return nullptr;
254 } 251 }
255 252
256 service_manager::InterfaceRegistry* MockRenderThread::GetInterfaceRegistry() {
257 if (!interface_registry_) {
258 interface_registry_ = base::MakeUnique<service_manager::InterfaceRegistry>(
259 service_manager::mojom::kServiceManager_ConnectorSpec);
260 }
261 return interface_registry_.get();
262 }
263
264 service_manager::Connector* MockRenderThread::GetConnector() { 253 service_manager::Connector* MockRenderThread::GetConnector() {
265 if (!connector_) { 254 if (!connector_) {
266 connector_ = 255 connector_ =
267 service_manager::Connector::Create(&pending_connector_request_); 256 service_manager::Connector::Create(&pending_connector_request_);
268 } 257 }
269 return connector_.get(); 258 return connector_.get();
270 } 259 }
271 260
272 void MockRenderThread::SetFieldTrialGroup(const std::string& trial_name, 261 void MockRenderThread::SetFieldTrialGroup(const std::string& trial_name,
273 const std::string& group_name) {} 262 const std::string& group_name) {}
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 void MockRenderThread::OnCreateWindow( 314 void MockRenderThread::OnCreateWindow(
326 const mojom::CreateNewWindowParams& params, 315 const mojom::CreateNewWindowParams& params,
327 mojom::CreateNewWindowReply* reply) { 316 mojom::CreateNewWindowReply* reply) {
328 reply->route_id = new_window_routing_id_; 317 reply->route_id = new_window_routing_id_;
329 reply->main_frame_route_id = new_window_main_frame_routing_id_; 318 reply->main_frame_route_id = new_window_main_frame_routing_id_;
330 reply->main_frame_widget_route_id = new_window_main_frame_widget_routing_id_; 319 reply->main_frame_widget_route_id = new_window_main_frame_widget_routing_id_;
331 reply->cloned_session_storage_namespace_id = 0; 320 reply->cloned_session_storage_namespace_id = 0;
332 } 321 }
333 322
334 } // namespace content 323 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/mock_render_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698