diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-02 16:14:46 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-02 16:14:46 +0000 |
commit | 8a42080741944d129bc3c5af69d8b480c9a77dab (patch) | |
tree | 2b2f062ec603a0c77c729c65cb0db1ea10c3f47f /base/process.h | |
parent | 88cb7aae56fb25519a659599695a38d8822e01f3 (diff) | |
download | chromium_src-8a42080741944d129bc3c5af69d8b480c9a77dab.zip chromium_src-8a42080741944d129bc3c5af69d8b480c9a77dab.tar.gz chromium_src-8a42080741944d129bc3c5af69d8b480c9a77dab.tar.bz2 |
Fix tab backgrounding
This broke because an incompatible change was made to Process, and because there was no test that would catch it. I've fixed the underlying problem for both Linux and ChromeOS and made it testable.
BUG=102726
TEST=Added new RenderProcessHostTest.Backgrounding
Review URL: http://codereview.chromium.org/8506036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112712 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process.h')
-rw-r--r-- | base/process.h | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/base/process.h b/base/process.h index 2670924..7869b88 100644 --- a/base/process.h +++ b/base/process.h @@ -34,37 +34,24 @@ const ProcessHandle kNullProcessHandle = 0; const ProcessId kNullProcessId = 0; #endif // defined(OS_WIN) -#if defined(OS_POSIX) && !defined(OS_MACOSX) -// saved_priority_ will be set to this to indicate that it's not holding -// a valid value. -20 to 19 are valid process priorities. -const int kUnsetProcessPriority = 256; -#endif - class BASE_EXPORT Process { public: Process() : process_(kNullProcessHandle) { -#if defined(OS_POSIX) && !defined(OS_MACOSX) - saved_priority_ = kUnsetProcessPriority; -#endif } explicit Process(ProcessHandle handle) : process_(handle) { -#if defined(OS_POSIX) && !defined(OS_MACOSX) - saved_priority_ = kUnsetProcessPriority; -#endif } // A handle to the current process. static Process Current(); + static bool CanBackgroundProcesses(); + // Get/Set the handle for this process. The handle will be 0 if the process // is no longer running. ProcessHandle handle() const { return process_; } void set_handle(ProcessHandle handle) { process_ = handle; -#if defined(OS_POSIX) && !defined(OS_MACOSX) - saved_priority_ = kUnsetProcessPriority; -#endif } // Get the PID for this process. @@ -98,11 +85,6 @@ class BASE_EXPORT Process { private: ProcessHandle process_; -#if defined(OS_POSIX) && !defined(OS_MACOSX) - // Holds the priority that the process was set to when it was backgrounded. - // If the process wasn't backgrounded it will be kUnsetProcessPriority. - int saved_priority_; -#endif }; } // namespace base |