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

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

Issue 2958133003: Enable GRC
Patch Set: Rebase Created 3 years, 5 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 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 AddUIThreadInterface( 1633 AddUIThreadInterface(
1634 registry.get(), 1634 registry.get(),
1635 base::Bind(&BroadcastChannelProvider::Connect, 1635 base::Bind(&BroadcastChannelProvider::Connect,
1636 base::Unretained( 1636 base::Unretained(
1637 storage_partition_impl_->GetBroadcastChannelProvider()))); 1637 storage_partition_impl_->GetBroadcastChannelProvider())));
1638 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { 1638 if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) {
1639 AddUIThreadInterface( 1639 AddUIThreadInterface(
1640 registry.get(), base::Bind(&CreateMemoryCoordinatorHandle, GetID())); 1640 registry.get(), base::Bind(&CreateMemoryCoordinatorHandle, GetID()));
1641 } 1641 }
1642 1642
1643 if (base::FeatureList::IsEnabled(features::kGlobalResourceCoordinator)) {
1644 AddUIThreadInterface(registry.get(),
1645 base::Bind(&CreateResourceCoordinatorProcessInterface,
1646 base::Unretained(this)));
1647 }
1648
1643 registry->AddInterface( 1649 registry->AddInterface(
1644 base::Bind(&MimeRegistryImpl::Create), 1650 base::Bind(&MimeRegistryImpl::Create),
1645 base::CreateSequencedTaskRunnerWithTraits( 1651 base::CreateSequencedTaskRunnerWithTraits(
1646 {base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN, 1652 {base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN,
1647 base::TaskPriority::USER_BLOCKING})); 1653 base::TaskPriority::USER_BLOCKING}));
1654
1648 #if BUILDFLAG(USE_MINIKIN_HYPHENATION) 1655 #if BUILDFLAG(USE_MINIKIN_HYPHENATION)
1649 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create), 1656 registry->AddInterface(base::Bind(&hyphenation::HyphenationImpl::Create),
1650 hyphenation::HyphenationImpl::GetTaskRunner()); 1657 hyphenation::HyphenationImpl::GetTaskRunner());
1651 #endif 1658 #endif
1652 1659
1653 registry->AddInterface(base::Bind(&device::GamepadMonitor::Create)); 1660 registry->AddInterface(base::Bind(&device::GamepadMonitor::Create));
1654 1661
1655 registry->AddInterface( 1662 registry->AddInterface(
1656 base::Bind(&PushMessagingManager::BindRequest, 1663 base::Bind(&PushMessagingManager::BindRequest,
1657 base::Unretained(push_messaging_manager_.get()))); 1664 base::Unretained(push_messaging_manager_.get())));
1658 1665
1659 registry->AddInterface( 1666 registry->AddInterface(
1660 base::Bind(&BackgroundFetchServiceImpl::Create, GetID(), 1667 base::Bind(&BackgroundFetchServiceImpl::Create, GetID(),
1661 make_scoped_refptr( 1668 make_scoped_refptr(
1662 storage_partition_impl_->GetBackgroundFetchContext()))); 1669 storage_partition_impl_->GetBackgroundFetchContext())));
1663 1670
1664 registry->AddInterface(base::Bind(&RenderProcessHostImpl::CreateMusGpuRequest, 1671 registry->AddInterface(base::Bind(&RenderProcessHostImpl::CreateMusGpuRequest,
1665 base::Unretained(this))); 1672 base::Unretained(this)));
1666 1673
1667 registry->AddInterface( 1674 registry->AddInterface(
1668 base::Bind(&VideoCaptureHost::Create, 1675 base::Bind(&VideoCaptureHost::Create,
1669 BrowserMainLoop::GetInstance()->media_stream_manager())); 1676 BrowserMainLoop::GetInstance()->media_stream_manager()));
1670 1677
1671 registry->AddInterface( 1678 registry->AddInterface(
1672 base::Bind(&metrics::CreateSingleSampleMetricsProvider)); 1679 base::Bind(&metrics::CreateSingleSampleMetricsProvider));
1673 1680
1674 if (base::FeatureList::IsEnabled(features::kGlobalResourceCoordinator)) {
1675 registry->AddInterface(base::Bind(
1676 &CreateResourceCoordinatorProcessInterface, base::Unretained(this)));
1677 }
1678
1679 if (base::FeatureList::IsEnabled(features::kOffMainThreadFetch)) { 1681 if (base::FeatureList::IsEnabled(features::kOffMainThreadFetch)) {
1680 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context( 1682 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context(
1681 static_cast<ServiceWorkerContextWrapper*>( 1683 static_cast<ServiceWorkerContextWrapper*>(
1682 storage_partition_impl_->GetServiceWorkerContext())); 1684 storage_partition_impl_->GetServiceWorkerContext()));
1683 registry->AddInterface( 1685 registry->AddInterface(
1684 base::Bind(&WorkerURLLoaderFactoryProviderImpl::Create, GetID(), 1686 base::Bind(&WorkerURLLoaderFactoryProviderImpl::Create, GetID(),
1685 resource_message_filter_, service_worker_context)); 1687 resource_message_filter_, service_worker_context));
1686 } 1688 }
1687 1689
1688 registry->AddInterface( 1690 registry->AddInterface(
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1912 Send(new ChildProcessMsg_Resume()); 1914 Send(new ChildProcessMsg_Resume());
1913 } 1915 }
1914 1916
1915 mojom::Renderer* RenderProcessHostImpl::GetRendererInterface() { 1917 mojom::Renderer* RenderProcessHostImpl::GetRendererInterface() {
1916 return renderer_interface_.get(); 1918 return renderer_interface_.get();
1917 } 1919 }
1918 1920
1919 resource_coordinator::ResourceCoordinatorInterface* 1921 resource_coordinator::ResourceCoordinatorInterface*
1920 RenderProcessHostImpl::GetProcessResourceCoordinator() { 1922 RenderProcessHostImpl::GetProcessResourceCoordinator() {
1921 if (!process_resource_coordinator_) { 1923 if (!process_resource_coordinator_) {
1922 base::ProcessHandle process_handle = GetHandle();
1923 DCHECK(process_handle);
1924
1925 process_resource_coordinator_ = 1924 process_resource_coordinator_ =
1926 base::MakeUnique<resource_coordinator::ResourceCoordinatorInterface>( 1925 base::MakeUnique<resource_coordinator::ResourceCoordinatorInterface>(
1927 ServiceManagerConnection::GetForProcess()->GetConnector(), 1926 ServiceManagerConnection::GetForProcess()->GetConnector(),
1928 resource_coordinator::CoordinationUnitType::kProcess, 1927 resource_coordinator::CoordinationUnitType::kProcess);
1929 base::Process(process_handle).Pid());
1930 } 1928 }
1931 return process_resource_coordinator_.get(); 1929 return process_resource_coordinator_.get();
1932 } 1930 }
1933 1931
1934 void RenderProcessHostImpl::SetIsNeverSuitableForReuse() { 1932 void RenderProcessHostImpl::SetIsNeverSuitableForReuse() {
1935 is_never_suitable_for_reuse_ = true; 1933 is_never_suitable_for_reuse_ = true;
1936 } 1934 }
1937 1935
1938 bool RenderProcessHostImpl::MayReuseHost() { 1936 bool RenderProcessHostImpl::MayReuseHost() {
1939 if (is_never_suitable_for_reuse_) 1937 if (is_never_suitable_for_reuse_)
(...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after
3805 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3803 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3806 3804
3807 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3805 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3808 // Capture the error message in a crash key value. 3806 // Capture the error message in a crash key value.
3809 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3807 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3810 bad_message::ReceivedBadMessage(render_process_id, 3808 bad_message::ReceivedBadMessage(render_process_id,
3811 bad_message::RPH_MOJO_PROCESS_ERROR); 3809 bad_message::RPH_MOJO_PROCESS_ERROR);
3812 } 3810 }
3813 3811
3814 } // namespace content 3812 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc ('k') | content/public/test/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698