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

Unified Diff: device/power_save_blocker/power_save_blocker.h

Issue 2371723002: Power Save Blocker: Eliminate passing ViewAndroid as WeakPtr (Closed)
Patch Set: Rebase Created 4 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
Index: device/power_save_blocker/power_save_blocker.h
diff --git a/device/power_save_blocker/power_save_blocker.h b/device/power_save_blocker/power_save_blocker.h
index ff77808c2536246bbb043dcd9caa9cc5cb4f8906..621eaef363ec4297e0cebec9a2d953c11b9ae91c 100644
--- a/device/power_save_blocker/power_save_blocker.h
+++ b/device/power_save_blocker/power_save_blocker.h
@@ -9,7 +9,6 @@
#include <string>
#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
#include "base/sequenced_task_runner.h"
#include "base/single_thread_task_runner.h"
#include "device/power_save_blocker/power_save_blocker_export.h"
@@ -65,9 +64,11 @@ class DEVICE_POWER_SAVE_BLOCKER_EXPORT PowerSaveBlocker {
#if defined(OS_ANDROID)
// On Android, the kPowerSaveBlockPreventDisplaySleep type of
// PowerSaveBlocker should associated with a View, so the blocker can be
- // removed by the platform.
+ // removed by the platform. Note that |view_android| is guaranteed to be
+ // valid only for the lifetime of this call; hence it should not be cached
+ // internally.
DEVICE_POWER_SAVE_BLOCKER_EXPORT void InitDisplaySleepBlocker(
- const base::WeakPtr<ui::ViewAndroid>& view_android);
+ ui::ViewAndroid* view_android);
#endif
private:
« no previous file with comments | « content/browser/wake_lock/wake_lock_service_context.cc ('k') | device/power_save_blocker/power_save_blocker_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698