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

Unified Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 589723003: Enable dark_resume_always workaround if the wake-on-packets flag is set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/chrome_browser_main_chromeos.cc
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
index da1c2b50f824061fe8431b3c1b5a96837cdfd4df..598fccbf65c3ddbc2abfa4bde8e28ab760677c0a 100644
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -132,6 +132,11 @@ namespace chromeos {
namespace {
+// TODO(chirantan): These are used by a temporary workaround for lucid sleep and
+// should be removed once the proper implementation is ready (crbug.com/414949).
+const char kDarkResumeAlwaysFile[] = "/sys/power/dark_resume_always";
+const char kEnableDarkResumeAlways[] = "1";
+
void ChromeOSVersionCallback(const std::string& version) {
base::SetLinuxDistro(std::string("CrOS ") + version);
}
@@ -566,9 +571,22 @@ void ChromeBrowserMainPartsChromeos::PostProfileInit() {
renderer_freezer_.reset(
new RendererFreezer(scoped_ptr<RendererFreezer::Delegate>(
new FreezerCgroupProcessManager())));
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kWakeOnPackets))
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kWakeOnPackets)) {
light_bar_.reset(new LightBar());
+ // Until the kernel can properly detect the wakeup source, we need to use a
+ // hack to tell the kernel to always enter dark resume. Chrome can then
+ // detect any user activity and have the power manager transition out of
+ // dark resume into regular resume. We don't care if the write succeeds or
+ // not because most devices will not have this file.
+ //
+ // TODO(chirantan): Remove this once we can properly detect the wakeup
+ // source (crbug.com/414949).
+ base::WriteFile(base::FilePath(kDarkResumeAlwaysFile),
Daniel Erat 2014/09/21 14:49:31 can you put this somewhere else instead of chrome_
+ kEnableDarkResumeAlways,
+ strlen(kEnableDarkResumeAlways));
+ }
+
g_browser_process->platform_part()->InitializeAutomaticRebootManager();
// This observer cannot be created earlier because it requires the shell to be
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698