| 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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 GetID())); | 1224 GetID())); |
| 1226 AddUIThreadInterface( | 1225 AddUIThreadInterface( |
| 1227 registry.get(), | 1226 registry.get(), |
| 1228 base::Bind(&RenderProcessHostImpl::CreateStoragePartitionService, | 1227 base::Bind(&RenderProcessHostImpl::CreateStoragePartitionService, |
| 1229 base::Unretained(this))); | 1228 base::Unretained(this))); |
| 1230 AddUIThreadInterface( | 1229 AddUIThreadInterface( |
| 1231 registry.get(), | 1230 registry.get(), |
| 1232 base::Bind(&BroadcastChannelProvider::Connect, | 1231 base::Bind(&BroadcastChannelProvider::Connect, |
| 1233 base::Unretained( | 1232 base::Unretained( |
| 1234 storage_partition_impl_->GetBroadcastChannelProvider()))); | 1233 storage_partition_impl_->GetBroadcastChannelProvider()))); |
| 1235 if (memory_coordinator::IsEnabled()) { | 1234 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { |
| 1236 AddUIThreadInterface( | 1235 AddUIThreadInterface( |
| 1237 registry.get(), base::Bind(&CreateMemoryCoordinatorHandle, GetID())); | 1236 registry.get(), base::Bind(&CreateMemoryCoordinatorHandle, GetID())); |
| 1238 } | 1237 } |
| 1239 | 1238 |
| 1240 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = | 1239 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner = |
| 1241 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); | 1240 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE); |
| 1242 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), | 1241 registry->AddInterface(base::Bind(&MimeRegistryImpl::Create), |
| 1243 file_task_runner); | 1242 file_task_runner); |
| 1244 #if defined(USE_MINIKIN_HYPHENATION) | 1243 #if defined(USE_MINIKIN_HYPHENATION) |
| 1245 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), | 1244 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), |
| (...skipping 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2983 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2982 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 2984 | 2983 |
| 2985 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2984 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
| 2986 // enough information here so that we can determine what the bad message was. | 2985 // enough information here so that we can determine what the bad message was. |
| 2987 base::debug::Alias(&error); | 2986 base::debug::Alias(&error); |
| 2988 bad_message::ReceivedBadMessage(process.get(), | 2987 bad_message::ReceivedBadMessage(process.get(), |
| 2989 bad_message::RPH_MOJO_PROCESS_ERROR); | 2988 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 2990 } | 2989 } |
| 2991 | 2990 |
| 2992 } // namespace content | 2991 } // namespace content |
| OLD | NEW |