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

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

Issue 2836813006: Revert of 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"
22 #include "testing/gtest/include/gtest/gtest.h" 25 #include "testing/gtest/include/gtest/gtest.h"
23 #include "third_party/WebKit/public/web/WebScriptController.h" 26 #include "third_party/WebKit/public/web/WebScriptController.h"
24 27
25 namespace content { 28 namespace content {
26 29
27 namespace { 30 namespace {
28 31
29 class MockRenderMessageFilterImpl : public mojom::RenderMessageFilter { 32 class MockRenderMessageFilterImpl : public mojom::RenderMessageFilter {
30 public: 33 public:
31 explicit MockRenderMessageFilterImpl(MockRenderThread* thread) 34 explicit MockRenderMessageFilterImpl(MockRenderThread* thread)
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 246
244 void MockRenderThread::ReleaseCachedFonts() { 247 void MockRenderThread::ReleaseCachedFonts() {
245 } 248 }
246 249
247 #endif // OS_WIN 250 #endif // OS_WIN
248 251
249 ServiceManagerConnection* MockRenderThread::GetServiceManagerConnection() { 252 ServiceManagerConnection* MockRenderThread::GetServiceManagerConnection() {
250 return nullptr; 253 return nullptr;
251 } 254 }
252 255
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
253 service_manager::Connector* MockRenderThread::GetConnector() { 264 service_manager::Connector* MockRenderThread::GetConnector() {
254 if (!connector_) { 265 if (!connector_) {
255 connector_ = 266 connector_ =
256 service_manager::Connector::Create(&pending_connector_request_); 267 service_manager::Connector::Create(&pending_connector_request_);
257 } 268 }
258 return connector_.get(); 269 return connector_.get();
259 } 270 }
260 271
261 void MockRenderThread::SetFieldTrialGroup(const std::string& trial_name, 272 void MockRenderThread::SetFieldTrialGroup(const std::string& trial_name,
262 const std::string& group_name) {} 273 const std::string& group_name) {}
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 void MockRenderThread::OnCreateWindow( 325 void MockRenderThread::OnCreateWindow(
315 const mojom::CreateNewWindowParams& params, 326 const mojom::CreateNewWindowParams& params,
316 mojom::CreateNewWindowReply* reply) { 327 mojom::CreateNewWindowReply* reply) {
317 reply->route_id = new_window_routing_id_; 328 reply->route_id = new_window_routing_id_;
318 reply->main_frame_route_id = new_window_main_frame_routing_id_; 329 reply->main_frame_route_id = new_window_main_frame_routing_id_;
319 reply->main_frame_widget_route_id = new_window_main_frame_widget_routing_id_; 330 reply->main_frame_widget_route_id = new_window_main_frame_widget_routing_id_;
320 reply->cloned_session_storage_namespace_id = 0; 331 reply->cloned_session_storage_namespace_id = 0;
321 } 332 }
322 333
323 } // namespace content 334 } // 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