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

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

Issue 2690203003: Convert push_messaging IPC msgs into mojo interfaces (Closed)
Patch Set: remove DCHECK(ChildThreadImpl::Current()) 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 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 #include "content/browser/memory/memory_coordinator_impl.h" 90 #include "content/browser/memory/memory_coordinator_impl.h"
91 #include "content/browser/memory/memory_message_filter.h" 91 #include "content/browser/memory/memory_message_filter.h"
92 #include "content/browser/message_port_message_filter.h" 92 #include "content/browser/message_port_message_filter.h"
93 #include "content/browser/mime_registry_impl.h" 93 #include "content/browser/mime_registry_impl.h"
94 #include "content/browser/notifications/notification_message_filter.h" 94 #include "content/browser/notifications/notification_message_filter.h"
95 #include "content/browser/notifications/platform_notification_context_impl.h" 95 #include "content/browser/notifications/platform_notification_context_impl.h"
96 #include "content/browser/payments/payment_app_manager.h" 96 #include "content/browser/payments/payment_app_manager.h"
97 #include "content/browser/permissions/permission_service_context.h" 97 #include "content/browser/permissions/permission_service_context.h"
98 #include "content/browser/permissions/permission_service_impl.h" 98 #include "content/browser/permissions/permission_service_impl.h"
99 #include "content/browser/profiler_message_filter.h" 99 #include "content/browser/profiler_message_filter.h"
100 #include "content/browser/push_messaging/push_messaging_message_filter.h" 100 #include "content/browser/push_messaging/push_messaging_manager.h"
101 #include "content/browser/quota_dispatcher_host.h" 101 #include "content/browser/quota_dispatcher_host.h"
102 #include "content/browser/renderer_host/clipboard_message_filter.h" 102 #include "content/browser/renderer_host/clipboard_message_filter.h"
103 #include "content/browser/renderer_host/database_message_filter.h" 103 #include "content/browser/renderer_host/database_message_filter.h"
104 #include "content/browser/renderer_host/file_utilities_message_filter.h" 104 #include "content/browser/renderer_host/file_utilities_message_filter.h"
105 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" 105 #include "content/browser/renderer_host/media/audio_input_renderer_host.h"
106 #include "content/browser/renderer_host/media/audio_renderer_host.h" 106 #include "content/browser/renderer_host/media/audio_renderer_host.h"
107 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h" 107 #include "content/browser/renderer_host/media/media_stream_dispatcher_host.h"
108 #include "content/browser/renderer_host/media/peer_connection_tracker_host.h" 108 #include "content/browser/renderer_host/media/peer_connection_tracker_host.h"
109 #include "content/browser/renderer_host/media/video_capture_host.h" 109 #include "content/browser/renderer_host/media/video_capture_host.h"
110 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_p rovider_impl.h" 110 #include "content/browser/renderer_host/offscreen_canvas_compositor_frame_sink_p rovider_impl.h"
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 mark_child_process_activity_time(); 722 mark_child_process_activity_time();
723 723
724 if (!GetBrowserContext()->IsOffTheRecord() && 724 if (!GetBrowserContext()->IsOffTheRecord() &&
725 !base::CommandLine::ForCurrentProcess()->HasSwitch( 725 !base::CommandLine::ForCurrentProcess()->HasSwitch(
726 switches::kDisableGpuShaderDiskCache)) { 726 switches::kDisableGpuShaderDiskCache)) {
727 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, 727 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
728 base::Bind(&CacheShaderInfo, GetID(), 728 base::Bind(&CacheShaderInfo, GetID(),
729 storage_partition_impl_->GetPath())); 729 storage_partition_impl_->GetPath()));
730 } 730 }
731 731
732 push_messaging_.reset(new PushMessagingManager(
733 GetID(), storage_partition_impl_->GetServiceWorkerContext()));
734
732 #if defined(OS_MACOSX) 735 #if defined(OS_MACOSX)
733 if (BootstrapSandboxManager::ShouldEnable()) 736 if (BootstrapSandboxManager::ShouldEnable())
734 AddObserver(BootstrapSandboxManager::GetInstance()); 737 AddObserver(BootstrapSandboxManager::GetInstance());
735 #endif 738 #endif
736 739
737 InitializeChannelProxy(); 740 InitializeChannelProxy();
738 } 741 }
739 742
740 // static 743 // static
741 void RenderProcessHostImpl::ShutDownInProcessRenderer() { 744 void RenderProcessHostImpl::ShutDownInProcessRenderer() {
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 static_cast<ServiceWorkerContextWrapper*>( 1186 static_cast<ServiceWorkerContextWrapper*>(
1184 storage_partition_impl_->GetServiceWorkerContext())); 1187 storage_partition_impl_->GetServiceWorkerContext()));
1185 notification_message_filter_ = new NotificationMessageFilter( 1188 notification_message_filter_ = new NotificationMessageFilter(
1186 GetID(), storage_partition_impl_->GetPlatformNotificationContext(), 1189 GetID(), storage_partition_impl_->GetPlatformNotificationContext(),
1187 resource_context, service_worker_context, browser_context); 1190 resource_context, service_worker_context, browser_context);
1188 AddFilter(notification_message_filter_.get()); 1191 AddFilter(notification_message_filter_.get());
1189 1192
1190 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); 1193 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER));
1191 AddFilter(new HistogramMessageFilter()); 1194 AddFilter(new HistogramMessageFilter());
1192 AddFilter(new MemoryMessageFilter(this)); 1195 AddFilter(new MemoryMessageFilter(this));
1193 AddFilter(new PushMessagingMessageFilter(
1194 GetID(), storage_partition_impl_->GetServiceWorkerContext()));
1195 #if defined(OS_ANDROID) 1196 #if defined(OS_ANDROID)
1196 AddFilter(new ScreenOrientationListenerAndroid()); 1197 AddFilter(new ScreenOrientationListenerAndroid());
1197 synchronous_compositor_filter_ = 1198 synchronous_compositor_filter_ =
1198 new SynchronousCompositorBrowserFilter(GetID()); 1199 new SynchronousCompositorBrowserFilter(GetID());
1199 AddFilter(synchronous_compositor_filter_.get()); 1200 AddFilter(synchronous_compositor_filter_.get());
1200 #endif 1201 #endif
1201 } 1202 }
1202 1203
1203 void RenderProcessHostImpl::RegisterMojoInterfaces() { 1204 void RenderProcessHostImpl::RegisterMojoInterfaces() {
1204 auto registry = base::MakeUnique<service_manager::InterfaceRegistry>( 1205 auto registry = base::MakeUnique<service_manager::InterfaceRegistry>(
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 // the IO thread. 1308 // the IO thread.
1308 registry->AddInterface(base::Bind(&device::DeviceLightHost::Create)); 1309 registry->AddInterface(base::Bind(&device::DeviceLightHost::Create));
1309 registry->AddInterface(base::Bind(&device::DeviceMotionHost::Create)); 1310 registry->AddInterface(base::Bind(&device::DeviceMotionHost::Create));
1310 registry->AddInterface(base::Bind(&device::DeviceOrientationHost::Create)); 1311 registry->AddInterface(base::Bind(&device::DeviceOrientationHost::Create));
1311 registry->AddInterface( 1312 registry->AddInterface(
1312 base::Bind(&device::DeviceOrientationAbsoluteHost::Create)); 1313 base::Bind(&device::DeviceOrientationAbsoluteHost::Create));
1313 #endif // defined(OS_ANDROID) 1314 #endif // defined(OS_ANDROID)
1314 1315
1315 registry->AddInterface(base::Bind(&device::GamepadMonitor::Create)); 1316 registry->AddInterface(base::Bind(&device::GamepadMonitor::Create));
1316 1317
1318 registry->AddInterface(base::Bind(&PushMessagingManager::BindRequest,
1319 base::Unretained(push_messaging_.get())));
1320
1317 registry->AddInterface(base::Bind(&RenderProcessHostImpl::CreateMusGpuRequest, 1321 registry->AddInterface(base::Bind(&RenderProcessHostImpl::CreateMusGpuRequest,
1318 base::Unretained(this))); 1322 base::Unretained(this)));
1319 1323
1320 registry->AddInterface( 1324 registry->AddInterface(
1321 base::Bind(&VideoCaptureHost::Create, 1325 base::Bind(&VideoCaptureHost::Create,
1322 BrowserMainLoop::GetInstance()->media_stream_manager())); 1326 BrowserMainLoop::GetInstance()->media_stream_manager()));
1323 1327
1324 // This is to support usage of WebSockets in cases in which there is no 1328 // This is to support usage of WebSockets in cases in which there is no
1325 // associated RenderFrame (e.g., Shared Workers). 1329 // associated RenderFrame (e.g., Shared Workers).
1326 AddUIThreadInterface( 1330 AddUIThreadInterface(
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after
3071 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3075 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3072 3076
3073 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3077 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3074 // Capture the error message in a crash key value. 3078 // Capture the error message in a crash key value.
3075 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3079 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3076 bad_message::ReceivedBadMessage(render_process_id, 3080 bad_message::ReceivedBadMessage(render_process_id,
3077 bad_message::RPH_MOJO_PROCESS_ERROR); 3081 bad_message::RPH_MOJO_PROCESS_ERROR);
3078 } 3082 }
3079 3083
3080 } // namespace content 3084 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698