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

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

Issue 2959383002: [GRC] Hook up the process-level CoordinationUnit (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | content/public/app/mojo/content_browser_manifest.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 using ProcessID = int; 846 using ProcessID = int;
847 using SiteProcessIDPair = std::pair<GURL, ProcessID>; 847 using SiteProcessIDPair = std::pair<GURL, ProcessID>;
848 using SiteProcessIDPairSet = std::set<SiteProcessIDPair>; 848 using SiteProcessIDPairSet = std::set<SiteProcessIDPair>;
849 849
850 // Use std::set because duplicates don't need to be tracked separately (eg., 850 // Use std::set because duplicates don't need to be tracked separately (eg.,
851 // service workers for the same site in the same process). It is sorted in the 851 // service workers for the same site in the same process). It is sorted in the
852 // order of insertion. 852 // order of insertion.
853 SiteProcessIDPairSet site_process_set_; 853 SiteProcessIDPairSet site_process_set_;
854 }; 854 };
855 855
856 void CreateResourceCoordinatorProcessInterface(
nasko 2017/06/29 17:24:28 nit: I'd move this to be closer to CreateMemoryCoo
lpy 2017/06/29 22:00:35 Done.
857 RenderProcessHostImpl* render_process_host,
858 const service_manager::BindSourceInfo& source_info,
859 resource_coordinator::mojom::CoordinationUnitRequest request) {
860 render_process_host->GetProcessResourceCoordinator()->service()->AddBinding(
861 std::move(request));
862 }
863
856 } // namespace 864 } // namespace
857 865
858 RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL; 866 RendererMainThreadFactoryFunction g_renderer_main_thread_factory = NULL;
859 867
860 base::MessageLoop* g_in_process_thread; 868 base::MessageLoop* g_in_process_thread;
861 869
862 // Stores the maximum number of renderer processes the content module can 870 // Stores the maximum number of renderer processes the content module can
863 // create. 871 // create.
864 static size_t g_max_renderer_count_override = 0; 872 static size_t g_max_renderer_count_override = 0;
865 873
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 registry->AddInterface(base::Bind(&RenderProcessHostImpl::CreateMusGpuRequest, 1663 registry->AddInterface(base::Bind(&RenderProcessHostImpl::CreateMusGpuRequest,
1656 base::Unretained(this))); 1664 base::Unretained(this)));
1657 1665
1658 registry->AddInterface( 1666 registry->AddInterface(
1659 base::Bind(&VideoCaptureHost::Create, 1667 base::Bind(&VideoCaptureHost::Create,
1660 BrowserMainLoop::GetInstance()->media_stream_manager())); 1668 BrowserMainLoop::GetInstance()->media_stream_manager()));
1661 1669
1662 registry->AddInterface( 1670 registry->AddInterface(
1663 base::Bind(&metrics::CreateSingleSampleMetricsProvider)); 1671 base::Bind(&metrics::CreateSingleSampleMetricsProvider));
1664 1672
1673 registry->AddInterface(base::Bind(&CreateResourceCoordinatorProcessInterface,
1674 base::Unretained(this)));
nasko 2017/06/29 21:52:46 Let's make this conditional on the GRC feature bei
lpy 2017/06/29 22:00:35 Done.
1675
1665 if (base::FeatureList::IsEnabled(features::kOffMainThreadFetch)) { 1676 if (base::FeatureList::IsEnabled(features::kOffMainThreadFetch)) {
1666 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context( 1677 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context(
1667 static_cast<ServiceWorkerContextWrapper*>( 1678 static_cast<ServiceWorkerContextWrapper*>(
1668 storage_partition_impl_->GetServiceWorkerContext())); 1679 storage_partition_impl_->GetServiceWorkerContext()));
1669 registry->AddInterface( 1680 registry->AddInterface(
1670 base::Bind(&WorkerURLLoaderFactoryProviderImpl::Create, GetID(), 1681 base::Bind(&WorkerURLLoaderFactoryProviderImpl::Create, GetID(),
1671 resource_message_filter_, service_worker_context)); 1682 resource_message_filter_, service_worker_context));
1672 } 1683 }
1673 1684
1674 // This is to support usage of WebSockets in cases in which there is no 1685 // This is to support usage of WebSockets in cases in which there is no
(...skipping 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after
3787 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3798 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3788 3799
3789 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3800 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3790 // Capture the error message in a crash key value. 3801 // Capture the error message in a crash key value.
3791 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3802 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3792 bad_message::ReceivedBadMessage(render_process_id, 3803 bad_message::ReceivedBadMessage(render_process_id,
3793 bad_message::RPH_MOJO_PROCESS_ERROR); 3804 bad_message::RPH_MOJO_PROCESS_ERROR);
3794 } 3805 }
3795 3806
3796 } // namespace content 3807 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/public/app/mojo/content_browser_manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698