1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_POWER_FREEZER_CGROUP_PROCESS_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_POWER_FREEZER_CGROUP_PROCESS_MANAGER_H_
10 #include "base/callback.h"
11 #include "base/files/file_path.h"
12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "base/process/process_handle.h"
16 #include "chrome/browser/chromeos/power/renderer_freezer.h"
19 class SequencedTaskRunner
;
24 // Manages all the processes in the freezer cgroup on Chrome OS.
25 class FreezerCgroupProcessManager
: public RendererFreezer::Delegate
{
27 FreezerCgroupProcessManager();
28 ~FreezerCgroupProcessManager() override
;
30 // RendererFreezer::Delegate overrides.
31 void SetShouldFreezeRenderer(base::ProcessHandle handle
,
32 bool frozen
) override
;
33 void FreezeRenderers() override
;
34 void ThawRenderers(ResultCallback callback
) override
;
35 void CheckCanFreezeRenderers(ResultCallback callback
) override
;
38 scoped_refptr
<base::SequencedTaskRunner
> file_thread_
;
41 scoped_ptr
<FileWorker
> file_worker_
;
43 DISALLOW_COPY_AND_ASSIGN(FreezerCgroupProcessManager
);
46 } // namespace chromeos
48 #endif // CHROME_BROWSER_CHROMEOS_POWER_FREEZER_CGROUP_PROCESS_MANAGER_H_