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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2214383002: Move registration of Java mojo interfaces to the new InterfaceRegistrar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@java-content-interface-registry
Patch Set: Created 4 years, 2 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 #include "ui/gfx/switches.h" 189 #include "ui/gfx/switches.h"
190 #include "ui/gl/gl_switches.h" 190 #include "ui/gl/gl_switches.h"
191 #include "ui/gl/gpu_switching_manager.h" 191 #include "ui/gl/gpu_switching_manager.h"
192 #include "ui/native_theme/native_theme_switches.h" 192 #include "ui/native_theme/native_theme_switches.h"
193 193
194 #if defined(OS_ANDROID) 194 #if defined(OS_ANDROID)
195 #include "content/browser/android/child_process_launcher_android.h" 195 #include "content/browser/android/child_process_launcher_android.h"
196 #include "content/browser/media/android/browser_demuxer_android.h" 196 #include "content/browser/media/android/browser_demuxer_android.h"
197 #include "content/browser/mojo/interface_registrar_android.h" 197 #include "content/browser/mojo/interface_registrar_android.h"
198 #include "content/browser/screen_orientation/screen_orientation_message_filter_a ndroid.h" 198 #include "content/browser/screen_orientation/screen_orientation_message_filter_a ndroid.h"
199 #include "content/public/browser/android/java_interfaces.h"
199 #include "ipc/ipc_sync_channel.h" 200 #include "ipc/ipc_sync_channel.h"
200 #include "media/audio/android/audio_manager_android.h" 201 #include "media/audio/android/audio_manager_android.h"
201 #endif 202 #endif
202 203
203 #if defined(OS_WIN) 204 #if defined(OS_WIN)
204 #include "base/win/scoped_com_initializer.h" 205 #include "base/win/scoped_com_initializer.h"
205 #include "base/win/windows_version.h" 206 #include "base/win/windows_version.h"
206 #include "content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h" 207 #include "content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h"
207 #include "content/common/font_cache_dispatcher_win.h" 208 #include "content/common/font_cache_dispatcher_win.h"
208 #include "content/common/sandbox_win.h" 209 #include "content/common/sandbox_win.h"
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 interface_registry_android_ = 1196 interface_registry_android_ =
1196 InterfaceRegistryAndroid::Create(registry.get()); 1197 InterfaceRegistryAndroid::Create(registry.get());
1197 InterfaceRegistrarAndroid::ExposeInterfacesToRenderer( 1198 InterfaceRegistrarAndroid::ExposeInterfacesToRenderer(
1198 interface_registry_android_.get()); 1199 interface_registry_android_.get());
1199 #endif 1200 #endif
1200 1201
1201 channel_->AddAssociatedInterface( 1202 channel_->AddAssociatedInterface(
1202 base::Bind(&RenderProcessHostImpl::OnRouteProviderRequest, 1203 base::Bind(&RenderProcessHostImpl::OnRouteProviderRequest,
1203 base::Unretained(this))); 1204 base::Unretained(this)));
1204 1205
1205 #if !defined(OS_ANDROID) 1206 #if defined(OS_ANDROID)
1207 AddUIThreadInterface(registry.get(),
1208 GetGlobalJavaInterfaces()
1209 ->CreateInterfaceFactory<device::BatteryMonitor>());
1210 #else
1206 AddUIThreadInterface( 1211 AddUIThreadInterface(
1207 registry.get(), base::Bind(&device::BatteryMonitorImpl::Create)); 1212 registry.get(), base::Bind(&device::BatteryMonitorImpl::Create));
1208 #endif 1213 #endif
1209 AddUIThreadInterface( 1214 AddUIThreadInterface(
1210 registry.get(), 1215 registry.get(),
1211 base::Bind(&PermissionServiceContext::CreateService, 1216 base::Bind(&PermissionServiceContext::CreateService,
1212 base::Unretained(permission_service_context_.get()))); 1217 base::Unretained(permission_service_context_.get())));
1213 // TODO(mcasas): finalize arguments. 1218 // TODO(mcasas): finalize arguments.
1214 AddUIThreadInterface(registry.get(), base::Bind(&ImageCaptureImpl::Create)); 1219 AddUIThreadInterface(registry.get(), base::Bind(&ImageCaptureImpl::Create));
1215 AddUIThreadInterface(registry.get(), 1220 AddUIThreadInterface(registry.get(),
(...skipping 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after
2993 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 2998 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
2994 2999
2995 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias 3000 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias
2996 // enough information here so that we can determine what the bad message was. 3001 // enough information here so that we can determine what the bad message was.
2997 base::debug::Alias(&error); 3002 base::debug::Alias(&error);
2998 bad_message::ReceivedBadMessage(process.get(), 3003 bad_message::ReceivedBadMessage(process.get(),
2999 bad_message::RPH_MOJO_PROCESS_ERROR); 3004 bad_message::RPH_MOJO_PROCESS_ERROR);
3000 } 3005 }
3001 3006
3002 } // namespace content 3007 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698