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

Unified Diff: content/browser/renderer_host/render_process_host_impl.h

Issue 2710823003: NOCOMMIT prototype: GRC service plumbing and process priority
Patch Set: Rebase Created 3 years, 7 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
Index: content/browser/renderer_host/render_process_host_impl.h
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h
index 8d5033e333f299c546c66977edd19e5b2a70dbe3..abf1a0168c3694b30d2694c242a1af223504d973 100644
--- a/content/browser/renderer_host/render_process_host_impl.h
+++ b/content/browser/renderer_host/render_process_host_impl.h
@@ -42,6 +42,7 @@
#include "mojo/public/cpp/bindings/associated_binding.h"
#include "mojo/public/cpp/bindings/associated_binding_set.h"
#include "mojo/public/cpp/bindings/interface_ptr.h"
+#include "services/resource_coordinator/public/cpp/resource_coordinator_interface.h"
#include "services/service_manager/public/cpp/binder_registry.h"
#include "services/service_manager/public/interfaces/service.mojom.h"
#include "services/ui/public/interfaces/gpu.mojom.h"
@@ -108,6 +109,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
: public RenderProcessHost,
public ChildProcessLauncher::Client,
public ui::GpuSwitchingObserver,
+ public resource_coordinator::mojom::CoordinationPolicyCallback,
public NON_EXPORTED_BASE(mojom::RouteProvider),
public NON_EXPORTED_BASE(mojom::AssociatedInterfaceProvider) {
public:
@@ -185,6 +187,9 @@ class CONTENT_EXPORT RenderProcessHostImpl
void PurgeAndSuspend() override;
void Resume() override;
mojom::Renderer* GetRendererInterface() override;
+ resource_coordinator::ResourceCoordinatorInterface*
+ GetProcessResourceCoordinator() override;
+
void SetIsNeverSuitableForReuse() override;
bool MayReuseHost() override;
@@ -206,6 +211,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
void OnProcessLaunched() override;
void OnProcessLaunchFailed(int error_code) override;
+ // resource_coordinator::mojom::CoordinationPolicyCallback implementation.
+ void SetCoordinationPolicy(
+ resource_coordinator::mojom::CoordinationPolicyPtr policy) override;
+
scoped_refptr<AudioRendererHost> audio_renderer_host() const;
// Call this function when it is evident that the child process is actively
@@ -414,7 +423,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
// Inspects the current object state and sets/removes background priority if
// appropriate. Should be called after any of the involved data members
// change.
- void UpdateProcessPriority();
+ void SetProcessPriority(bool should_background);
// Creates a PersistentMemoryAllocator and shares it with the renderer
// process for it to store histograms from that process. The allocator is
@@ -680,6 +689,11 @@ class CONTENT_EXPORT RenderProcessHostImpl
// if a process should be backgrounded.
int audio_stream_count_ = 0;
+ std::unique_ptr<resource_coordinator::ResourceCoordinatorInterface>
+ process_resource_coordinator_;
+ mojo::Binding<resource_coordinator::mojom::CoordinationPolicyCallback>
+ resource_coordinator_binding_;
+
// A WeakPtrFactory which is reset every time Cleanup() runs. Used to vend
// WeakPtrs which are invalidated any time the RPHI is recycled.
std::unique_ptr<base::WeakPtrFactory<RenderProcessHostImpl>>
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698