OLD | NEW |
---|---|
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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 #include "content/public/browser/notification_types.h" | 141 #include "content/public/browser/notification_types.h" |
142 #include "content/public/browser/render_process_host_factory.h" | 142 #include "content/public/browser/render_process_host_factory.h" |
143 #include "content/public/browser/render_process_host_observer.h" | 143 #include "content/public/browser/render_process_host_observer.h" |
144 #include "content/public/browser/render_widget_host.h" | 144 #include "content/public/browser/render_widget_host.h" |
145 #include "content/public/browser/render_widget_host_iterator.h" | 145 #include "content/public/browser/render_widget_host_iterator.h" |
146 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" | 146 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" |
147 #include "content/public/browser/resource_context.h" | 147 #include "content/public/browser/resource_context.h" |
148 #include "content/public/browser/user_metrics.h" | 148 #include "content/public/browser/user_metrics.h" |
149 #include "content/public/browser/worker_service.h" | 149 #include "content/public/browser/worker_service.h" |
150 #include "content/public/common/child_process_host.h" | 150 #include "content/public/common/child_process_host.h" |
151 #include "content/public/common/connection_filter.h" | |
151 #include "content/public/common/content_constants.h" | 152 #include "content/public/common/content_constants.h" |
152 #include "content/public/common/content_features.h" | 153 #include "content/public/common/content_features.h" |
153 #include "content/public/common/content_switches.h" | 154 #include "content/public/common/content_switches.h" |
154 #include "content/public/common/mojo_channel_switches.h" | 155 #include "content/public/common/mojo_channel_switches.h" |
155 #include "content/public/common/process_type.h" | 156 #include "content/public/common/process_type.h" |
156 #include "content/public/common/resource_type.h" | 157 #include "content/public/common/resource_type.h" |
157 #include "content/public/common/result_codes.h" | 158 #include "content/public/common/result_codes.h" |
158 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 159 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
159 #include "content/public/common/url_constants.h" | 160 #include "content/public/common/url_constants.h" |
160 #include "device/battery/battery_monitor_impl.h" | 161 #include "device/battery/battery_monitor_impl.h" |
161 #include "gpu/GLES2/gl2extchromium.h" | 162 #include "gpu/GLES2/gl2extchromium.h" |
162 #include "gpu/command_buffer/client/gpu_switches.h" | 163 #include "gpu/command_buffer/client/gpu_switches.h" |
163 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 164 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
164 #include "gpu/command_buffer/service/gpu_switches.h" | 165 #include "gpu/command_buffer/service/gpu_switches.h" |
165 #include "ipc/attachment_broker.h" | 166 #include "ipc/attachment_broker.h" |
166 #include "ipc/attachment_broker_privileged.h" | 167 #include "ipc/attachment_broker_privileged.h" |
167 #include "ipc/ipc_channel.h" | 168 #include "ipc/ipc_channel.h" |
168 #include "ipc/ipc_channel_mojo.h" | 169 #include "ipc/ipc_channel_mojo.h" |
169 #include "ipc/ipc_logging.h" | 170 #include "ipc/ipc_logging.h" |
170 #include "ipc/ipc_switches.h" | 171 #include "ipc/ipc_switches.h" |
171 #include "media/base/media_switches.h" | 172 #include "media/base/media_switches.h" |
172 #include "mojo/edk/embedder/embedder.h" | 173 #include "mojo/edk/embedder/embedder.h" |
173 #include "net/url_request/url_request_context_getter.h" | 174 #include "net/url_request/url_request_context_getter.h" |
174 #include "ppapi/shared_impl/ppapi_switches.h" | 175 #include "ppapi/shared_impl/ppapi_switches.h" |
176 #include "services/shell/public/cpp/connection.h" | |
175 #include "services/shell/public/cpp/interface_provider.h" | 177 #include "services/shell/public/cpp/interface_provider.h" |
176 #include "services/shell/public/cpp/interface_registry.h" | 178 #include "services/shell/public/cpp/interface_registry.h" |
177 #include "services/shell/runner/common/switches.h" | 179 #include "services/shell/runner/common/switches.h" |
178 #include "storage/browser/fileapi/sandbox_file_system_backend.h" | 180 #include "storage/browser/fileapi/sandbox_file_system_backend.h" |
179 #include "third_party/skia/include/core/SkBitmap.h" | 181 #include "third_party/skia/include/core/SkBitmap.h" |
180 #include "ui/base/ui_base_switches.h" | 182 #include "ui/base/ui_base_switches.h" |
181 #include "ui/display/display_switches.h" | 183 #include "ui/display/display_switches.h" |
182 #include "ui/events/event_switches.h" | 184 #include "ui/events/event_switches.h" |
183 #include "ui/gfx/switches.h" | 185 #include "ui/gfx/switches.h" |
184 #include "ui/gl/gl_switches.h" | 186 #include "ui/gl/gl_switches.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
446 BrowserMainLoop::GetInstance()->memory_coordinator()->CreateHandle( | 448 BrowserMainLoop::GetInstance()->memory_coordinator()->CreateHandle( |
447 render_process_id, std::move(request)); | 449 render_process_id, std::move(request)); |
448 } | 450 } |
449 | 451 |
450 } // namespace | 452 } // namespace |
451 | 453 |
452 RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL; | 454 RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL; |
453 | 455 |
454 base::MessageLoop* g_in_process_thread; | 456 base::MessageLoop* g_in_process_thread; |
455 | 457 |
458 // Stores the maximum number of renderer processes the content module can | |
459 // create. | |
460 static size_t g_max_renderer_count_override = 0; | |
461 | |
462 // static | |
463 bool g_run_renderer_in_process_ = false; | |
464 | |
465 // Held by the RPH's BrowserContext's MojoShellConnection, ownership transferred | |
466 // back to RPH upon RPH destruction. | |
467 class RenderProcessHostImpl::ConnectionFilterImpl : public ConnectionFilter { | |
468 public: | |
469 ConnectionFilterImpl( | |
470 const shell::Identity& child_identity, | |
471 std::unique_ptr<shell::InterfaceRegistry> registry) | |
472 : child_identity_(child_identity), | |
473 registry_(std::move(registry)) {} | |
474 ~ConnectionFilterImpl() override {} | |
475 | |
476 private: | |
477 // ConnectionFilter: | |
478 bool OnConnect(shell::Connection* connection, | |
479 shell::Connector* connector) override { | |
480 // We only fulfill connections from the renderer we host. | |
481 const shell::Identity& remote_identity = connection->GetRemoteIdentity(); | |
482 if (child_identity_.name() != remote_identity.name() || | |
Ken Rockot(use gerrit already)
2016/07/29 17:09:45
Could we just add a != operator to Identity? Shoul
Ben Goodger (Google)
2016/07/29 19:35:02
Can't use user_id since user_id for outbound conne
| |
483 child_identity_.instance() != remote_identity.instance()) { | |
484 return false; | |
485 } | |
486 | |
487 std::set<std::string> interface_names; | |
488 registry_->GetInterfaceNames(&interface_names); | |
489 for (auto& interface_name : interface_names) { | |
490 connection->GetInterfaceRegistry()->AddInterface( | |
491 interface_name, | |
492 base::Bind(&ConnectionFilterImpl::GetInterface, | |
493 base::Unretained(this), | |
Ken Rockot(use gerrit already)
2016/07/29 17:09:46
This is not safe. The registered callbacks may cal
| |
494 interface_name)); | |
495 } | |
496 return true; | |
497 } | |
498 | |
499 void GetInterface(const std::string& interface_name, | |
500 mojo::ScopedMessagePipeHandle handle) { | |
501 shell::mojom::InterfaceProvider* provider = registry_.get(); | |
502 provider->GetInterface(interface_name, std::move(handle)); | |
503 } | |
504 | |
505 shell::Identity child_identity_; | |
506 std::unique_ptr<shell::InterfaceRegistry> registry_; | |
507 | |
508 DISALLOW_COPY_AND_ASSIGN(ConnectionFilterImpl); | |
509 }; | |
510 | |
456 base::MessageLoop* | 511 base::MessageLoop* |
457 RenderProcessHostImpl::GetInProcessRendererThreadForTesting() { | 512 RenderProcessHostImpl::GetInProcessRendererThreadForTesting() { |
458 return g_in_process_thread; | 513 return g_in_process_thread; |
459 } | 514 } |
460 | 515 |
461 // Stores the maximum number of renderer processes the content module can | |
462 // create. | |
463 static size_t g_max_renderer_count_override = 0; | |
464 | |
465 // static | 516 // static |
466 size_t RenderProcessHost::GetMaxRendererProcessCount() { | 517 size_t RenderProcessHost::GetMaxRendererProcessCount() { |
467 if (g_max_renderer_count_override) | 518 if (g_max_renderer_count_override) |
468 return g_max_renderer_count_override; | 519 return g_max_renderer_count_override; |
469 | 520 |
470 #if defined(OS_ANDROID) | 521 #if defined(OS_ANDROID) |
471 // On Android we don't maintain a limit of renderer process hosts - we are | 522 // On Android we don't maintain a limit of renderer process hosts - we are |
472 // happy with keeping a lot of these, as long as the number of live renderer | 523 // happy with keeping a lot of these, as long as the number of live renderer |
473 // processes remains reasonable, and on Android the OS takes care of that. | 524 // processes remains reasonable, and on Android the OS takes care of that. |
474 return std::numeric_limits<size_t>::max(); | 525 return std::numeric_limits<size_t>::max(); |
(...skipping 27 matching lines...) Expand all Loading... | |
502 max_count /= kEstimatedWebContentsMemoryUsage; | 553 max_count /= kEstimatedWebContentsMemoryUsage; |
503 | 554 |
504 const size_t kMinRendererProcessCount = 3; | 555 const size_t kMinRendererProcessCount = 3; |
505 max_count = std::max(max_count, kMinRendererProcessCount); | 556 max_count = std::max(max_count, kMinRendererProcessCount); |
506 max_count = std::min(max_count, kMaxRendererProcessCount); | 557 max_count = std::min(max_count, kMaxRendererProcessCount); |
507 } | 558 } |
508 return max_count; | 559 return max_count; |
509 } | 560 } |
510 | 561 |
511 // static | 562 // static |
512 bool g_run_renderer_in_process_ = false; | |
513 | |
514 // static | |
515 void RenderProcessHost::SetMaxRendererProcessCount(size_t count) { | 563 void RenderProcessHost::SetMaxRendererProcessCount(size_t count) { |
516 g_max_renderer_count_override = count; | 564 g_max_renderer_count_override = count; |
517 } | 565 } |
518 | 566 |
519 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) | 567 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) |
520 // static | 568 // static |
521 void RenderProcessHostImpl::EarlyZygoteLaunch() { | 569 void RenderProcessHostImpl::EarlyZygoteLaunch() { |
522 DCHECK(!g_render_zygote); | 570 DCHECK(!g_render_zygote); |
523 // TODO(kerrnel): Investigate doing this without the ZygoteHostImpl as a | 571 // TODO(kerrnel): Investigate doing this without the ZygoteHostImpl as a |
524 // proxy. It is currently done this way due to concerns about race | 572 // proxy. It is currently done this way due to concerns about race |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
742 #endif // !defined(OS_MACOSX) | 790 #endif // !defined(OS_MACOSX) |
743 | 791 |
744 #if defined(OS_ANDROID) | 792 #if defined(OS_ANDROID) |
745 // Initialize the java audio manager so that media session tests will pass. | 793 // Initialize the java audio manager so that media session tests will pass. |
746 // See internal b/29872494. | 794 // See internal b/29872494. |
747 static_cast<media::AudioManagerAndroid*>(media::AudioManager::Get())-> | 795 static_cast<media::AudioManagerAndroid*>(media::AudioManager::Get())-> |
748 InitializeIfNeeded(); | 796 InitializeIfNeeded(); |
749 #endif // defined(OS_ANDROID) | 797 #endif // defined(OS_ANDROID) |
750 | 798 |
751 CreateMessageFilters(); | 799 CreateMessageFilters(); |
752 RegisterMojoInterfaces(); | 800 std::unique_ptr<shell::InterfaceRegistry> registry( |
Ken Rockot(use gerrit already)
2016/07/29 17:09:45
Can't you just put all this junk in RegisterMojoIn
| |
801 new shell::InterfaceRegistry(nullptr)); | |
802 #if defined(OS_ANDROID) | |
803 interface_registry_android_ = | |
804 InterfaceRegistryAndroid::Create(registry.get()); | |
805 InterfaceRegistrarAndroid::ExposeInterfacesToRenderer( | |
806 interface_registry_android_.get()); | |
807 #endif | |
808 | |
809 RegisterMojoInterfaces(registry.get()); | |
810 MojoShellConnection* mojo_shell_connection = | |
811 BrowserContext::GetMojoShellConnectionFor(browser_context_); | |
812 std::unique_ptr<ConnectionFilterImpl> connection_filter( | |
813 new ConnectionFilterImpl(mojo_child_connection_->child_identity(), | |
814 std::move(registry))); | |
815 connection_filter_ = connection_filter.get(); | |
816 mojo_shell_connection->AddConnectionFilter(std::move(connection_filter)); | |
753 | 817 |
754 if (run_renderer_in_process()) { | 818 if (run_renderer_in_process()) { |
755 DCHECK(g_renderer_main_thread_factory); | 819 DCHECK(g_renderer_main_thread_factory); |
756 // Crank up a thread and run the initialization there. With the way that | 820 // Crank up a thread and run the initialization there. With the way that |
757 // messages flow between the browser and renderer, this thread is required | 821 // messages flow between the browser and renderer, this thread is required |
758 // to prevent a deadlock in single-process mode. Since the primordial | 822 // to prevent a deadlock in single-process mode. Since the primordial |
759 // thread in the renderer process runs the WebKit code and can sometimes | 823 // thread in the renderer process runs the WebKit code and can sometimes |
760 // make blocking calls to the UI thread (i.e. this thread), they need to run | 824 // make blocking calls to the UI thread (i.e. this thread), they need to run |
761 // on separate threads. | 825 // on separate threads. |
762 in_process_renderer_.reset( | 826 in_process_renderer_.reset( |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1040 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); | 1104 AddFilter(new ProfilerMessageFilter(PROCESS_TYPE_RENDERER)); |
1041 AddFilter(new HistogramMessageFilter()); | 1105 AddFilter(new HistogramMessageFilter()); |
1042 AddFilter(new MemoryMessageFilter(this)); | 1106 AddFilter(new MemoryMessageFilter(this)); |
1043 AddFilter(new PushMessagingMessageFilter( | 1107 AddFilter(new PushMessagingMessageFilter( |
1044 GetID(), storage_partition_impl_->GetServiceWorkerContext())); | 1108 GetID(), storage_partition_impl_->GetServiceWorkerContext())); |
1045 #if defined(OS_ANDROID) | 1109 #if defined(OS_ANDROID) |
1046 AddFilter(new ScreenOrientationMessageFilterAndroid()); | 1110 AddFilter(new ScreenOrientationMessageFilterAndroid()); |
1047 #endif | 1111 #endif |
1048 } | 1112 } |
1049 | 1113 |
1050 void RenderProcessHostImpl::RegisterMojoInterfaces() { | 1114 void RenderProcessHostImpl::RegisterMojoInterfaces( |
1115 shell::InterfaceRegistry* registry) { | |
1116 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner = | |
1117 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI); | |
1051 #if !defined(OS_ANDROID) | 1118 #if !defined(OS_ANDROID) |
1052 GetInterfaceRegistry()->AddInterface( | 1119 registry->AddInterface(base::Bind(&device::BatteryMonitorImpl::Create), |
1053 base::Bind(&device::BatteryMonitorImpl::Create)); | 1120 ui_task_runner); |
Ken Rockot(use gerrit already)
2016/07/29 17:09:45
It's pretty unfortunate that we have to add ui_tas
| |
1054 #endif | 1121 #endif |
1055 | 1122 registry->AddInterface( |
1056 GetInterfaceRegistry()->AddInterface( | |
1057 base::Bind(&PermissionServiceContext::CreateService, | 1123 base::Bind(&PermissionServiceContext::CreateService, |
1058 base::Unretained(permission_service_context_.get()))); | 1124 base::Unretained(permission_service_context_.get())), |
1059 | 1125 ui_task_runner); |
1060 // TODO(mcasas): finalize arguments. | 1126 // TODO(mcasas): finalize arguments. |
1061 GetInterfaceRegistry()->AddInterface( | 1127 registry->AddInterface(base::Bind(&ImageCaptureImpl::Create), |
1062 base::Bind(&ImageCaptureImpl::Create)); | 1128 ui_task_runner); |
1063 | 1129 registry->AddInterface(base::Bind(&OffscreenCanvasSurfaceImpl::Create), |
1064 GetInterfaceRegistry()->AddInterface( | 1130 ui_task_runner); |
1065 base::Bind(&OffscreenCanvasSurfaceImpl::Create)); | 1131 registry->AddInterface( |
1066 | 1132 base::Bind(&BackgroundSyncContext::CreateService, |
1067 GetInterfaceRegistry()->AddInterface(base::Bind( | 1133 base::Unretained( |
1068 &BackgroundSyncContext::CreateService, | 1134 storage_partition_impl_->GetBackgroundSyncContext())), |
1069 base::Unretained(storage_partition_impl_->GetBackgroundSyncContext()))); | 1135 ui_task_runner); |
1070 | 1136 registry->AddInterface( |
1071 GetInterfaceRegistry()->AddInterface(base::Bind( | 1137 base::Bind(&PlatformNotificationContextImpl::CreateService, |
1072 &PlatformNotificationContextImpl::CreateService, | 1138 base::Unretained( |
1073 base::Unretained( | 1139 storage_partition_impl_->GetPlatformNotificationContext()), |
1074 storage_partition_impl_->GetPlatformNotificationContext()), GetID())); | 1140 GetID()), |
1075 | 1141 ui_task_runner); |
1076 GetInterfaceRegistry()->AddInterface( | 1142 registry->AddInterface( |
1077 base::Bind(&RenderProcessHostImpl::CreateStoragePartitionService, | 1143 base::Bind(&RenderProcessHostImpl::CreateStoragePartitionService, |
1078 base::Unretained(this))); | 1144 base::Unretained(this)), |
1079 | 1145 ui_task_runner); |
1080 GetInterfaceRegistry()->AddInterface( | 1146 registry->AddInterface( |
1081 base::Bind(&BroadcastChannelProvider::Connect, | 1147 base::Bind(&BroadcastChannelProvider::Connect, |
1082 base::Unretained( | 1148 base::Unretained( |
1083 storage_partition_impl_->GetBroadcastChannelProvider()))); | 1149 storage_partition_impl_->GetBroadcastChannelProvider())), |
1150 ui_task_runner); | |
1151 if (memory_coordinator::IsEnabled()) { | |
1152 registry->AddInterface(base::Bind(&CreateMemoryCoordinatorHandle, GetID()), | |
1153 ui_task_runner); | |
1154 } | |
1084 | 1155 |
1085 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = | 1156 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = |
1086 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); | 1157 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); |
1087 GetInterfaceRegistry()->AddInterface( | 1158 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), |
1088 base::Bind(&MimeRegistryImpl::Create), file_task_runner); | 1159 file_task_runner); |
1089 | |
1090 #if defined(USE_MINIKIN_HYPHENATION) | 1160 #if defined(USE_MINIKIN_HYPHENATION) |
1091 GetInterfaceRegistry()->AddInterface( | 1161 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), |
1092 base::Bind(&hyphenation::HyphenationImpl::Create), file_task_runner); | 1162 file_task_runner); |
1093 #endif | 1163 #endif |
1094 | 1164 |
1095 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 1165 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
1096 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); | 1166 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); |
1097 GetInterfaceRegistry()->AddInterface(base::Bind(&DeviceLightHost::Create), | 1167 registry->AddInterface(base::Bind(&DeviceLightHost::Create), io_task_runner); |
Ken Rockot(use gerrit already)
2016/07/29 17:09:45
io_task_runner isn't necessary now, it just needle
| |
1098 io_task_runner); | 1168 registry->AddInterface(base::Bind(&DeviceMotionHost::Create), io_task_runner); |
1099 GetInterfaceRegistry()->AddInterface(base::Bind(&DeviceMotionHost::Create), | 1169 registry->AddInterface(base::Bind(&DeviceOrientationHost::Create), |
1100 io_task_runner); | 1170 io_task_runner); |
1101 GetInterfaceRegistry()->AddInterface( | 1171 registry->AddInterface(base::Bind(&DeviceOrientationAbsoluteHost::Create), |
1102 base::Bind(&DeviceOrientationHost::Create), io_task_runner); | 1172 io_task_runner); |
1103 GetInterfaceRegistry()->AddInterface( | |
1104 base::Bind(&DeviceOrientationAbsoluteHost::Create), io_task_runner); | |
1105 | 1173 |
1106 if (memory_coordinator::IsEnabled()) { | 1174 GetContentClient()->browser()->ExposeInterfacesToRenderer(registry, this); |
1107 GetInterfaceRegistry()->AddInterface( | |
1108 base::Bind(&CreateMemoryCoordinatorHandle, GetID())); | |
1109 } | |
1110 | |
1111 #if defined(OS_ANDROID) | |
1112 InterfaceRegistrarAndroid::ExposeInterfacesToRenderer( | |
1113 mojo_child_connection_->interface_registry_android()); | |
1114 #endif | |
1115 | |
1116 GetContentClient()->browser()->ExposeInterfacesToRenderer( | |
1117 GetInterfaceRegistry(), this); | |
1118 } | 1175 } |
1119 | 1176 |
1120 void RenderProcessHostImpl::CreateStoragePartitionService( | 1177 void RenderProcessHostImpl::CreateStoragePartitionService( |
1121 mojo::InterfaceRequest<mojom::StoragePartitionService> request) { | 1178 mojo::InterfaceRequest<mojom::StoragePartitionService> request) { |
1122 // DO NOT REMOVE THIS COMMAND LINE CHECK WITHOUT SECURITY REVIEW! | 1179 // DO NOT REMOVE THIS COMMAND LINE CHECK WITHOUT SECURITY REVIEW! |
1123 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1180 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
1124 switches::kMojoLocalStorage)) { | 1181 switches::kMojoLocalStorage)) { |
1125 storage_partition_impl_->Bind(std::move(request)); | 1182 storage_partition_impl_->Bind(std::move(request)); |
1126 } | 1183 } |
1127 } | 1184 } |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1913 RenderProcessHostObserver, observers_, | 1970 RenderProcessHostObserver, observers_, |
1914 RenderProcessExited(this, base::TERMINATION_STATUS_NORMAL_TERMINATION, | 1971 RenderProcessExited(this, base::TERMINATION_STATUS_NORMAL_TERMINATION, |
1915 0)); | 1972 0)); |
1916 } | 1973 } |
1917 FOR_EACH_OBSERVER(RenderProcessHostObserver, observers_, | 1974 FOR_EACH_OBSERVER(RenderProcessHostObserver, observers_, |
1918 RenderProcessHostDestroyed(this)); | 1975 RenderProcessHostDestroyed(this)); |
1919 NotificationService::current()->Notify( | 1976 NotificationService::current()->Notify( |
1920 NOTIFICATION_RENDERER_PROCESS_TERMINATED, | 1977 NOTIFICATION_RENDERER_PROCESS_TERMINATED, |
1921 Source<RenderProcessHost>(this), NotificationService::NoDetails()); | 1978 Source<RenderProcessHost>(this), NotificationService::NoDetails()); |
1922 | 1979 |
1980 if (connection_filter_) { | |
1981 MojoShellConnection* mojo_shell_connection = | |
1982 BrowserContext::GetMojoShellConnectionFor(browser_context_); | |
1983 // Throw the result away, so the connection filter is deleted. | |
1984 mojo_shell_connection->RemoveConnectionFilter(connection_filter_); | |
1985 } | |
1986 | |
1923 #ifndef NDEBUG | 1987 #ifndef NDEBUG |
1924 is_self_deleted_ = true; | 1988 is_self_deleted_ = true; |
1925 #endif | 1989 #endif |
1926 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); | 1990 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); |
1927 deleting_soon_ = true; | 1991 deleting_soon_ = true; |
1928 | 1992 |
1929 #if USE_ATTACHMENT_BROKER | 1993 #if USE_ATTACHMENT_BROKER |
1930 IPC::AttachmentBroker::GetGlobal()->DeregisterCommunicationChannel( | 1994 IPC::AttachmentBroker::GetGlobal()->DeregisterCommunicationChannel( |
1931 channel_.get()); | 1995 channel_.get()); |
1932 #endif | 1996 #endif |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2762 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2826 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
2763 | 2827 |
2764 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2828 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
2765 // enough information here so that we can determine what the bad message was. | 2829 // enough information here so that we can determine what the bad message was. |
2766 base::debug::Alias(&error); | 2830 base::debug::Alias(&error); |
2767 bad_message::ReceivedBadMessage(process.get(), | 2831 bad_message::ReceivedBadMessage(process.get(), |
2768 bad_message::RPH_MOJO_PROCESS_ERROR); | 2832 bad_message::RPH_MOJO_PROCESS_ERROR); |
2769 } | 2833 } |
2770 | 2834 |
2771 } // namespace content | 2835 } // namespace content |
OLD | NEW |