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

Side by Side Diff: chrome/browser/chromeos/power/freezer_cgroup_process_manager.h

Issue 738993002: Re-land chromeos: Add non-extension renderers to the freezer cgroup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/power/freezer_cgroup_process_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_POWER_FREEZER_CGROUP_PROCESS_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_POWER_FREEZER_CGROUP_PROCESS_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_POWER_FREEZER_CGROUP_PROCESS_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_POWER_FREEZER_CGROUP_PROCESS_MANAGER_H_
7 7
8 #include <string>
9
8 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/process/process_handle.h"
10 #include "chrome/browser/chromeos/power/renderer_freezer.h" 13 #include "chrome/browser/chromeos/power/renderer_freezer.h"
11 14
12 namespace chromeos { 15 namespace chromeos {
13 16
14 // Manages all the processes in the freezer cgroup on Chrome OS. 17 // Manages all the processes in the freezer cgroup on Chrome OS.
15 class FreezerCgroupProcessManager : public RendererFreezer::Delegate { 18 class FreezerCgroupProcessManager : public RendererFreezer::Delegate {
16 public: 19 public:
17 FreezerCgroupProcessManager(); 20 FreezerCgroupProcessManager();
18 virtual ~FreezerCgroupProcessManager(); 21 ~FreezerCgroupProcessManager() override;
19 22
20 // RendererFreezer::Delegate overrides. 23 // RendererFreezer::Delegate overrides.
21 virtual bool FreezeRenderers() override; 24 void SetShouldFreezeRenderer(base::ProcessHandle handle,
22 virtual bool ThawRenderers() override; 25 bool frozen) override;
23 virtual bool CanFreezeRenderers() override; 26 bool FreezeRenderers() override;
27 bool ThawRenderers() override;
28 bool CanFreezeRenderers() override;
24 29
25 private: 30 private:
26 bool WriteCommandToStateFile(const std::string& command); 31 bool WriteCommandToFile(const std::string& command,
32 const base::FilePath& file);
27 33
28 base::FilePath state_path_; 34 // Control path for the cgroup that is not frozen.
35 base::FilePath default_control_path_;
36
37 // Control and state paths for the cgroup whose processes will be frozen.
38 base::FilePath to_be_frozen_control_path_;
39 base::FilePath to_be_frozen_state_path_;
40
29 bool enabled_; 41 bool enabled_;
30 42
31 DISALLOW_COPY_AND_ASSIGN(FreezerCgroupProcessManager); 43 DISALLOW_COPY_AND_ASSIGN(FreezerCgroupProcessManager);
32 }; 44 };
33 45
34 } // namespace chromeos 46 } // namespace chromeos
35 47
36 #endif // CHROME_BROWSER_CHROMEOS_POWER_FREEZER_CGROUP_PROCESS_MANAGER_H_ 48 #endif // CHROME_BROWSER_CHROMEOS_POWER_FREEZER_CGROUP_PROCESS_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/power/freezer_cgroup_process_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698