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

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

Issue 1214393004: Proposed new approach for SetBackgrounded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dchecks. Created 5 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
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 8937fd1e561d188c12005ef4fa3f2161b7cfcb6d..41b645f2b3c4de2c6ef29069554ce82b0c462bfa 100644
--- a/content/browser/renderer_host/render_process_host_impl.h
+++ b/content/browser/renderer_host/render_process_host_impl.h
@@ -329,8 +329,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
const base::CommandLine& browser_cmd,
base::CommandLine* renderer_cmd) const;
- // Callers can reduce the RenderProcess' priority.
- void SetBackgrounded(bool backgrounded);
+ // 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();
// Handle termination of our process.
void ProcessDied(bool already_dead, RendererClosedDetails* known_details);
@@ -361,8 +363,9 @@ class CONTENT_EXPORT RenderProcessHostImpl
// backgrounded.
int32 visible_widgets_;
- // Does this process have backgrounded priority.
- bool backgrounded_;
+ // Whether this process currently has backgrounded priority. Tracked so that
+ // UpdateProcessPriority() can avoid redundantly setting the priority.
+ bool is_process_backgrounded_;
// Used to allow a RenderWidgetHost to intercept various messages on the
// IO thread.

Powered by Google App Engine
This is Rietveld 408576698