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

Unified Diff: content/public/test/mock_render_process_host.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/test/mock_render_process_host.h ('k') | services/resource_coordinator/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/mock_render_process_host.cc
diff --git a/content/public/test/mock_render_process_host.cc b/content/public/test/mock_render_process_host.cc
index efabfce444a60371907bca9a41666f0b3fdac22d..e8fdc8366a12b7e555bb395913b692ac074d179a 100644
--- a/content/public/test/mock_render_process_host.cc
+++ b/content/public/test/mock_render_process_host.cc
@@ -30,8 +30,10 @@
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_widget_host_iterator.h"
#include "content/public/browser/storage_partition.h"
+#include "content/public/common/service_manager_connection.h"
#include "media/media_features.h"
#include "mojo/public/cpp/bindings/associated_interface_ptr.h"
+#include "services/resource_coordinator/public/interfaces/coordination_unit.mojom.h"
namespace content {
@@ -347,8 +349,14 @@ mojom::Renderer* MockRenderProcessHost::GetRendererInterface() {
resource_coordinator::ResourceCoordinatorInterface*
MockRenderProcessHost::GetProcessResourceCoordinator() {
- NOTREACHED();
- return nullptr;
+ if (!process_resource_coordinator_) {
+ service_manager::Connector* connector =
+ content::ServiceManagerConnection::GetForProcess()->GetConnector();
+ process_resource_coordinator_ =
+ base::MakeUnique<resource_coordinator::ResourceCoordinatorInterface>(
+ connector, resource_coordinator::CoordinationUnitType::kProcess);
+ }
+ return process_resource_coordinator_.get();
}
void MockRenderProcessHost::SetIsNeverSuitableForReuse() {
« no previous file with comments | « content/public/test/mock_render_process_host.h ('k') | services/resource_coordinator/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698