OLD | NEW |
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 #include "chrome/browser/chromeos/power/freezer_cgroup_process_manager.h" | 5 #include "chrome/browser/chromeos/power/freezer_cgroup_process_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 void ThawRenderers(ResultCallback callback) { | 83 void ThawRenderers(ResultCallback callback) { |
84 DCHECK(file_thread_->RunsTasksOnCurrentThread()); | 84 DCHECK(file_thread_->RunsTasksOnCurrentThread()); |
85 | 85 |
86 if (!enabled_) { | 86 if (!enabled_) { |
87 LOG(ERROR) << "Attempting to thaw renderers when the freezer cgroup is " | 87 LOG(ERROR) << "Attempting to thaw renderers when the freezer cgroup is " |
88 << "not available."; | 88 << "not available."; |
89 return; | 89 return; |
90 } | 90 } |
91 | 91 |
| 92 LOG(FATAL) << "Crash on Thaw"; |
| 93 |
92 bool result = WriteCommandToFile(kThawCommand, to_be_frozen_state_path_); | 94 bool result = WriteCommandToFile(kThawCommand, to_be_frozen_state_path_); |
93 ui_thread_->PostTask(FROM_HERE, base::Bind(callback, result)); | 95 ui_thread_->PostTask(FROM_HERE, base::Bind(callback, result)); |
94 } | 96 } |
95 | 97 |
96 void CheckCanFreezeRenderers(ResultCallback callback) { | 98 void CheckCanFreezeRenderers(ResultCallback callback) { |
97 DCHECK(file_thread_->RunsTasksOnCurrentThread()); | 99 DCHECK(file_thread_->RunsTasksOnCurrentThread()); |
98 | 100 |
99 ui_thread_->PostTask(FROM_HERE, base::Bind(callback, enabled_)); | 101 ui_thread_->PostTask(FROM_HERE, base::Bind(callback, enabled_)); |
100 } | 102 } |
101 | 103 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 169 |
168 void FreezerCgroupProcessManager::CheckCanFreezeRenderers( | 170 void FreezerCgroupProcessManager::CheckCanFreezeRenderers( |
169 ResultCallback callback) { | 171 ResultCallback callback) { |
170 file_thread_->PostTask(FROM_HERE, | 172 file_thread_->PostTask(FROM_HERE, |
171 base::Bind(&FileWorker::CheckCanFreezeRenderers, | 173 base::Bind(&FileWorker::CheckCanFreezeRenderers, |
172 base::Unretained(file_worker_.get()), | 174 base::Unretained(file_worker_.get()), |
173 callback)); | 175 callback)); |
174 } | 176 } |
175 | 177 |
176 } // namespace chromeos | 178 } // namespace chromeos |
OLD | NEW |