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

Unified Diff: chrome/browser/chromeos/power/renderer_freezer.h

Issue 536753004: chromeos: power: Make RendererFreezer asynchronous (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build errors 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 | chrome/browser/chromeos/power/renderer_freezer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/power/renderer_freezer.h
diff --git a/chrome/browser/chromeos/power/renderer_freezer.h b/chrome/browser/chromeos/power/renderer_freezer.h
index 4db0cf2f5f922bed16b9bc25a21a78b022d8e7bd..5af26f8cb22a68f0426bfc63910065030b5a6dd1 100644
--- a/chrome/browser/chromeos/power/renderer_freezer.h
+++ b/chrome/browser/chromeos/power/renderer_freezer.h
@@ -5,7 +5,9 @@
#ifndef CHROME_BROWSER_CHROMEOS_POWER_RENDERER_FREEZER_H_
#define CHROME_BROWSER_CHROMEOS_POWER_RENDERER_FREEZER_H_
+#include "base/callback.h"
#include "base/files/file_path.h"
+#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "chromeos/chromeos_export.h"
#include "chromeos/dbus/power_manager_client.h"
@@ -26,10 +28,17 @@ class CHROMEOS_EXPORT RendererFreezer : public PowerManagerClient::Observer {
virtual void SuspendDone(const base::TimeDelta& sleep_duration) OVERRIDE;
private:
+ void OnReadyToSuspend();
+
base::FilePath state_path_;
bool enabled_;
bool frozen_;
+ // Callback used to asynchronously report suspend readiness.
+ base::Closure suspend_readiness_callback_;
+
+ base::WeakPtrFactory<RendererFreezer> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(RendererFreezer);
};
« no previous file with comments | « no previous file | chrome/browser/chromeos/power/renderer_freezer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698