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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 285333003: Support exposing Mojo services between render frames, render threads, and their respective hosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: InterfaceRequest in RenderFrameSetup Created 6 years, 6 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 (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/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "content/child/worker_task_runner.h" 44 #include "content/child/worker_task_runner.h"
45 #include "content/common/child_process_messages.h" 45 #include "content/common/child_process_messages.h"
46 #include "content/common/content_constants_internal.h" 46 #include "content/common/content_constants_internal.h"
47 #include "content/common/database_messages.h" 47 #include "content/common/database_messages.h"
48 #include "content/common/dom_storage/dom_storage_messages.h" 48 #include "content/common/dom_storage/dom_storage_messages.h"
49 #include "content/common/gpu/client/context_provider_command_buffer.h" 49 #include "content/common/gpu/client/context_provider_command_buffer.h"
50 #include "content/common/gpu/client/gpu_channel_host.h" 50 #include "content/common/gpu/client/gpu_channel_host.h"
51 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" 51 #include "content/common/gpu/client/gpu_memory_buffer_impl.h"
52 #include "content/common/gpu/gpu_messages.h" 52 #include "content/common/gpu/gpu_messages.h"
53 #include "content/common/gpu/gpu_process_launch_causes.h" 53 #include "content/common/gpu/gpu_process_launch_causes.h"
54 #include "content/common/mojo/mojo_service_names.h"
55 #include "content/common/resource_messages.h" 54 #include "content/common/resource_messages.h"
56 #include "content/common/view_messages.h" 55 #include "content/common/view_messages.h"
57 #include "content/common/worker_messages.h" 56 #include "content/common/worker_messages.h"
58 #include "content/public/common/content_constants.h" 57 #include "content/public/common/content_constants.h"
59 #include "content/public/common/content_paths.h" 58 #include "content/public/common/content_paths.h"
60 #include "content/public/common/content_switches.h" 59 #include "content/public/common/content_switches.h"
61 #include "content/public/common/renderer_preferences.h" 60 #include "content/public/common/renderer_preferences.h"
62 #include "content/public/common/url_constants.h" 61 #include "content/public/common/url_constants.h"
63 #include "content/public/renderer/content_renderer_client.h" 62 #include "content/public/renderer/content_renderer_client.h"
64 #include "content/public/renderer/render_process_observer.h" 63 #include "content/public/renderer/render_process_observer.h"
(...skipping 20 matching lines...) Expand all
85 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" 84 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
86 #include "content/renderer/media/webrtc_identity_service.h" 85 #include "content/renderer/media/webrtc_identity_service.h"
87 #include "content/renderer/net_info_helper.h" 86 #include "content/renderer/net_info_helper.h"
88 #include "content/renderer/p2p/socket_dispatcher.h" 87 #include "content/renderer/p2p/socket_dispatcher.h"
89 #include "content/renderer/render_process_impl.h" 88 #include "content/renderer/render_process_impl.h"
90 #include "content/renderer/render_view_impl.h" 89 #include "content/renderer/render_view_impl.h"
91 #include "content/renderer/renderer_webkitplatformsupport_impl.h" 90 #include "content/renderer/renderer_webkitplatformsupport_impl.h"
92 #include "content/renderer/service_worker/embedded_worker_context_message_filter .h" 91 #include "content/renderer/service_worker/embedded_worker_context_message_filter .h"
93 #include "content/renderer/service_worker/embedded_worker_dispatcher.h" 92 #include "content/renderer/service_worker/embedded_worker_dispatcher.h"
94 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h" 93 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h"
95 #include "content/renderer/web_ui_setup_impl.h"
96 #include "grit/content_resources.h" 94 #include "grit/content_resources.h"
97 #include "ipc/ipc_channel_handle.h" 95 #include "ipc/ipc_channel_handle.h"
98 #include "ipc/ipc_forwarding_message_filter.h" 96 #include "ipc/ipc_forwarding_message_filter.h"
99 #include "ipc/ipc_platform_file.h" 97 #include "ipc/ipc_platform_file.h"
100 #include "media/base/audio_hardware_config.h" 98 #include "media/base/audio_hardware_config.h"
101 #include "media/base/media.h" 99 #include "media/base/media.h"
102 #include "media/filters/gpu_video_accelerator_factories.h" 100 #include "media/filters/gpu_video_accelerator_factories.h"
103 #include "mojo/common/common_type_converters.h" 101 #include "mojo/common/common_type_converters.h"
104 #include "net/base/net_errors.h" 102 #include "net/base/net_errors.h"
105 #include "net/base/net_util.h" 103 #include "net/base/net_util.h"
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 void RenderThreadImpl::PreCacheFont(const LOGFONT& log_font) { 1084 void RenderThreadImpl::PreCacheFont(const LOGFONT& log_font) {
1087 Send(new ChildProcessHostMsg_PreCacheFont(log_font)); 1085 Send(new ChildProcessHostMsg_PreCacheFont(log_font));
1088 } 1086 }
1089 1087
1090 void RenderThreadImpl::ReleaseCachedFonts() { 1088 void RenderThreadImpl::ReleaseCachedFonts() {
1091 Send(new ChildProcessHostMsg_ReleaseCachedFonts()); 1089 Send(new ChildProcessHostMsg_ReleaseCachedFonts());
1092 } 1090 }
1093 1091
1094 #endif // OS_WIN 1092 #endif // OS_WIN
1095 1093
1094 ServiceRegistry* RenderThreadImpl::GetServiceRegistry() {
1095 return service_registry();
1096 }
1097
1096 bool RenderThreadImpl::IsMainThread() { 1098 bool RenderThreadImpl::IsMainThread() {
1097 return !!current(); 1099 return !!current();
1098 } 1100 }
1099 1101
1100 base::MessageLoop* RenderThreadImpl::GetMainLoop() { 1102 base::MessageLoop* RenderThreadImpl::GetMainLoop() {
1101 return message_loop(); 1103 return message_loop();
1102 } 1104 }
1103 1105
1104 scoped_refptr<base::MessageLoopProxy> RenderThreadImpl::GetIOLoopProxy() { 1106 scoped_refptr<base::MessageLoopProxy> RenderThreadImpl::GetIOLoopProxy() {
1105 return io_message_loop_proxy_; 1107 return io_message_loop_proxy_;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 success = sync_message_filter()->Send(message); 1168 success = sync_message_filter()->Send(message);
1167 1169
1168 if (!success) 1170 if (!success)
1169 return scoped_ptr<gfx::GpuMemoryBuffer>(); 1171 return scoped_ptr<gfx::GpuMemoryBuffer>();
1170 1172
1171 return GpuMemoryBufferImpl::CreateFromHandle( 1173 return GpuMemoryBufferImpl::CreateFromHandle(
1172 handle, gfx::Size(width, height), internalformat) 1174 handle, gfx::Size(width, height), internalformat)
1173 .PassAs<gfx::GpuMemoryBuffer>(); 1175 .PassAs<gfx::GpuMemoryBuffer>();
1174 } 1176 }
1175 1177
1176 void RenderThreadImpl::ConnectToService(
1177 const mojo::String& service_url,
1178 const mojo::String& service_name,
1179 mojo::ScopedMessagePipeHandle message_pipe,
1180 const mojo::String& requestor_url) {
1181 // TODO(darin): Invent some kind of registration system to use here.
1182 if (service_url.To<base::StringPiece>() == kRendererService_WebUISetup) {
1183 WebUISetupImpl::Bind(message_pipe.Pass());
1184 } else {
1185 NOTREACHED() << "Unknown service name";
1186 }
1187 }
1188
1189 void RenderThreadImpl::DoNotSuspendWebKitSharedTimer() { 1178 void RenderThreadImpl::DoNotSuspendWebKitSharedTimer() {
1190 suspend_webkit_shared_timer_ = false; 1179 suspend_webkit_shared_timer_ = false;
1191 } 1180 }
1192 1181
1193 void RenderThreadImpl::DoNotNotifyWebKitOfModalLoop() { 1182 void RenderThreadImpl::DoNotNotifyWebKitOfModalLoop() {
1194 notify_webkit_of_modal_loop_ = false; 1183 notify_webkit_of_modal_loop_ = false;
1195 } 1184 }
1196 1185
1197 void RenderThreadImpl::OnSetZoomLevelForCurrentURL(const std::string& scheme, 1186 void RenderThreadImpl::OnSetZoomLevelForCurrentURL(const std::string& scheme,
1198 const std::string& host, 1187 const std::string& host,
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 hidden_widget_count_--; 1503 hidden_widget_count_--;
1515 1504
1516 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { 1505 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) {
1517 return; 1506 return;
1518 } 1507 }
1519 1508
1520 ScheduleIdleHandler(kLongIdleHandlerDelayMs); 1509 ScheduleIdleHandler(kLongIdleHandlerDelayMs);
1521 } 1510 }
1522 1511
1523 } // namespace content 1512 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698