From b378803abc532b532711f519938b674ce38a34b9 Mon Sep 17 00:00:00 2001
From: "simonhatch@chromium.org"
 <simonhatch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Sat, 18 May 2013 00:14:46 +0000
Subject: Lower the priority of shared workers that aren't associated with the
 foreground tab.

This should help out less powerful devices in the case where there's a shared worker in another tab and a cpu intensive page in the foreground.

BUG=
TEST=Open a doc, see webworker running, switch tabs and check webworker's priority by outputting contents of /sys/fs/cgroup/cpu/chrome_renderers/background/cgroup.proc on ChromeOS. With an open doc in a background tab, run 720p video (ie. youtube) at fullscreen, should stay fairly smooth.

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=199840

Review URL: https://chromiumcodereview.appspot.com/14137016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200932 0039d316-1c4b-4281-b951-d872f2087c98
---
 content/browser/browser_child_process_host_impl.cc | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'content/browser/browser_child_process_host_impl.cc')

diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc
index 6a2218f..9851e8c 100644
--- a/content/browser/browser_child_process_host_impl.cc
+++ b/content/browser/browser_child_process_host_impl.cc
@@ -205,6 +205,10 @@ void BrowserChildProcessHostImpl::ForceShutdown() {
   child_process_host_->ForceShutdown();
 }
 
+void BrowserChildProcessHostImpl::SetBackgrounded(bool backgrounded) {
+  child_process_->SetProcessBackgrounded(backgrounded);
+}
+
 void BrowserChildProcessHostImpl::SetTerminateChildOnShutdown(
     bool terminate_on_shutdown) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-- 
cgit v1.1