| 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 29 matching lines...) Expand all Loading... |
| 40 #include "base/synchronization/lock.h" | 40 #include "base/synchronization/lock.h" |
| 41 #include "base/sys_info.h" | 41 #include "base/sys_info.h" |
| 42 #include "base/threading/thread.h" | 42 #include "base/threading/thread.h" |
| 43 #include "base/threading/thread_restrictions.h" | 43 #include "base/threading/thread_restrictions.h" |
| 44 #include "base/threading/thread_task_runner_handle.h" | 44 #include "base/threading/thread_task_runner_handle.h" |
| 45 #include "base/trace_event/trace_event.h" | 45 #include "base/trace_event/trace_event.h" |
| 46 #include "base/tracked_objects.h" | 46 #include "base/tracked_objects.h" |
| 47 #include "build/build_config.h" | 47 #include "build/build_config.h" |
| 48 #include "cc/base/switches.h" | 48 #include "cc/base/switches.h" |
| 49 #include "cc/output/buffer_to_texture_target_map.h" | 49 #include "cc/output/buffer_to_texture_target_map.h" |
| 50 #include "components/memory_coordinator/browser/memory_coordinator.h" | |
| 51 #include "components/memory_coordinator/common/memory_coordinator_features.h" | |
| 52 #include "components/tracing/common/tracing_switches.h" | 50 #include "components/tracing/common/tracing_switches.h" |
| 53 #include "content/browser/appcache/appcache_dispatcher_host.h" | 51 #include "content/browser/appcache/appcache_dispatcher_host.h" |
| 54 #include "content/browser/appcache/chrome_appcache_service.h" | 52 #include "content/browser/appcache/chrome_appcache_service.h" |
| 55 #include "content/browser/background_sync/background_sync_service_impl.h" | 53 #include "content/browser/background_sync/background_sync_service_impl.h" |
| 56 #include "content/browser/bad_message.h" | 54 #include "content/browser/bad_message.h" |
| 57 #include "content/browser/blob_storage/blob_dispatcher_host.h" | 55 #include "content/browser/blob_storage/blob_dispatcher_host.h" |
| 58 #include "content/browser/blob_storage/chrome_blob_storage_context.h" | 56 #include "content/browser/blob_storage/chrome_blob_storage_context.h" |
| 59 #include "content/browser/broadcast_channel/broadcast_channel_provider.h" | 57 #include "content/browser/broadcast_channel/broadcast_channel_provider.h" |
| 60 #include "content/browser/browser_child_process_host_impl.h" | 58 #include "content/browser/browser_child_process_host_impl.h" |
| 61 #include "content/browser/browser_main.h" | 59 #include "content/browser/browser_main.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 77 #include "content/browser/histogram_message_filter.h" | 75 #include "content/browser/histogram_message_filter.h" |
| 78 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 76 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
| 79 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" | 77 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" |
| 80 #include "content/browser/loader/resource_message_filter.h" | 78 #include "content/browser/loader/resource_message_filter.h" |
| 81 #include "content/browser/loader/resource_scheduler_filter.h" | 79 #include "content/browser/loader/resource_scheduler_filter.h" |
| 82 #include "content/browser/loader/url_loader_factory_impl.h" | 80 #include "content/browser/loader/url_loader_factory_impl.h" |
| 83 #include "content/browser/media/capture/audio_mirroring_manager.h" | 81 #include "content/browser/media/capture/audio_mirroring_manager.h" |
| 84 #include "content/browser/media/capture/image_capture_impl.h" | 82 #include "content/browser/media/capture/image_capture_impl.h" |
| 85 #include "content/browser/media/media_internals.h" | 83 #include "content/browser/media/media_internals.h" |
| 86 #include "content/browser/media/midi_host.h" | 84 #include "content/browser/media/midi_host.h" |
| 85 #include "content/browser/memory/memory_coordinator.h" |
| 87 #include "content/browser/memory/memory_message_filter.h" | 86 #include "content/browser/memory/memory_message_filter.h" |
| 88 #include "content/browser/message_port_message_filter.h" | 87 #include "content/browser/message_port_message_filter.h" |
| 89 #include "content/browser/mime_registry_impl.h" | 88 #include "content/browser/mime_registry_impl.h" |
| 90 #include "content/browser/notifications/notification_message_filter.h" | 89 #include "content/browser/notifications/notification_message_filter.h" |
| 91 #include "content/browser/notifications/platform_notification_context_impl.h" | 90 #include "content/browser/notifications/platform_notification_context_impl.h" |
| 92 #include "content/browser/permissions/permission_service_context.h" | 91 #include "content/browser/permissions/permission_service_context.h" |
| 93 #include "content/browser/permissions/permission_service_impl.h" | 92 #include "content/browser/permissions/permission_service_impl.h" |
| 94 #include "content/browser/profiler_message_filter.h" | 93 #include "content/browser/profiler_message_filter.h" |
| 95 #include "content/browser/push_messaging/push_messaging_message_filter.h" | 94 #include "content/browser/push_messaging/push_messaging_message_filter.h" |
| 96 #include "content/browser/quota_dispatcher_host.h" | 95 #include "content/browser/quota_dispatcher_host.h" |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 } | 450 } |
| 452 | 451 |
| 453 private: | 452 private: |
| 454 std::unique_ptr<std::map<int, SessionStorageNamespaceMap>> | 453 std::unique_ptr<std::map<int, SessionStorageNamespaceMap>> |
| 455 session_storage_namespaces_awaiting_close_; | 454 session_storage_namespaces_awaiting_close_; |
| 456 DISALLOW_COPY_AND_ASSIGN(SessionStorageHolder); | 455 DISALLOW_COPY_AND_ASSIGN(SessionStorageHolder); |
| 457 }; | 456 }; |
| 458 | 457 |
| 459 void CreateMemoryCoordinatorHandle( | 458 void CreateMemoryCoordinatorHandle( |
| 460 int render_process_id, | 459 int render_process_id, |
| 461 memory_coordinator::mojom::MemoryCoordinatorHandleRequest request) { | 460 mojom::MemoryCoordinatorHandleRequest request) { |
| 462 memory_coordinator::MemoryCoordinator::GetInstance()->CreateHandle( | 461 MemoryCoordinator::GetInstance()->CreateHandle(render_process_id, |
| 463 render_process_id, std::move(request)); | 462 std::move(request)); |
| 464 } | 463 } |
| 465 | 464 |
| 466 } // namespace | 465 } // namespace |
| 467 | 466 |
| 468 RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL; | 467 RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL; |
| 469 | 468 |
| 470 base::MessageLoop* g_in_process_thread; | 469 base::MessageLoop* g_in_process_thread; |
| 471 | 470 |
| 472 // Stores the maximum number of renderer processes the content module can | 471 // Stores the maximum number of renderer processes the content module can |
| 473 // create. | 472 // create. |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 GetID())); | 1238 GetID())); |
| 1240 AddUIThreadInterface( | 1239 AddUIThreadInterface( |
| 1241 registry.get(), | 1240 registry.get(), |
| 1242 base::Bind(&RenderProcessHostImpl::CreateStoragePartitionService, | 1241 base::Bind(&RenderProcessHostImpl::CreateStoragePartitionService, |
| 1243 base::Unretained(this))); | 1242 base::Unretained(this))); |
| 1244 AddUIThreadInterface( | 1243 AddUIThreadInterface( |
| 1245 registry.get(), | 1244 registry.get(), |
| 1246 base::Bind(&BroadcastChannelProvider::Connect, | 1245 base::Bind(&BroadcastChannelProvider::Connect, |
| 1247 base::Unretained( | 1246 base::Unretained( |
| 1248 storage_partition_impl_->GetBroadcastChannelProvider()))); | 1247 storage_partition_impl_->GetBroadcastChannelProvider()))); |
| 1249 if (memory_coordinator::IsEnabled()) { | 1248 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { |
| 1250 AddUIThreadInterface( | 1249 AddUIThreadInterface( |
| 1251 registry.get(), base::Bind(&CreateMemoryCoordinatorHandle, GetID())); | 1250 registry.get(), base::Bind(&CreateMemoryCoordinatorHandle, GetID())); |
| 1252 } | 1251 } |
| 1253 | 1252 |
| 1254 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = | 1253 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = |
| 1255 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); | 1254 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); |
| 1256 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), | 1255 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), |
| 1257 file_task_runner); | 1256 file_task_runner); |
| 1258 #if defined(USE_MINIKIN_HYPHENATION) | 1257 #if defined(USE_MINIKIN_HYPHENATION) |
| 1259 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), | 1258 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), |
| (...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2965 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2964 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 2966 | 2965 |
| 2967 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2966 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
| 2968 // enough information here so that we can determine what the bad message was. | 2967 // enough information here so that we can determine what the bad message was. |
| 2969 base::debug::Alias(&error); | 2968 base::debug::Alias(&error); |
| 2970 bad_message::ReceivedBadMessage(process.get(), | 2969 bad_message::ReceivedBadMessage(process.get(), |
| 2971 bad_message::RPH_MOJO_PROCESS_ERROR); | 2970 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 2972 } | 2971 } |
| 2973 | 2972 |
| 2974 } // namespace content | 2973 } // namespace content |
| OLD | NEW |