Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_BROWSER_POWER_SAVE_BLOCKER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_POWER_SAVE_BLOCKER_IMPL_H_ |
| 6 #define CONTENT_BROWSER_POWER_SAVE_BLOCKER_IMPL_H_ | 6 #define CONTENT_BROWSER_POWER_SAVE_BLOCKER_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "content/public/browser/power_save_blocker.h" | 13 #include "content/public/browser/power_save_blocker.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 class WebContents; | 17 class WebContents; |
| 18 | 18 |
| 19 class PowerSaveBlockerImpl : public PowerSaveBlocker { | 19 class PowerSaveBlockerImpl : public PowerSaveBlocker { |
| 20 public: | 20 public: |
| 21 PowerSaveBlockerImpl(PowerSaveBlockerType type, | 21 PowerSaveBlockerImpl( |
| 22 Reason reason, | 22 PowerSaveBlockerType type, |
| 23 const std::string& description); | 23 Reason reason, |
| 24 const std::string& description, | |
| 25 scoped_refptr<base::SequencedTaskRunner> ui_task_runner, | |
| 26 scoped_refptr<base::SequencedTaskRunner> file_task_runner); | |
| 24 ~PowerSaveBlockerImpl() override; | 27 ~PowerSaveBlockerImpl() override; |
| 25 | 28 |
| 26 #if defined(OS_ANDROID) | 29 #if defined(OS_ANDROID) |
| 27 // In Android platform, the kPowerSaveBlockPreventDisplaySleep type of | 30 // In Android platform, the kPowerSaveBlockPreventDisplaySleep type of |
| 28 // PowerSaveBlocker should associated with a WebContents, so the blocker | 31 // PowerSaveBlocker should associated with a WebContents, so the blocker |
| 29 // could be removed by platform if the WebContents is hidden. | 32 // could be removed by platform if the WebContents is hidden. |
| 30 void InitDisplaySleepBlocker(WebContents* web_contents); | 33 void InitDisplaySleepBlocker(WebContents* web_contents); |
| 31 #endif | 34 #endif |
| 32 | 35 |
| 33 private: | 36 private: |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 45 // }; | 48 // }; |
| 46 scoped_refptr<Delegate> delegate_; | 49 scoped_refptr<Delegate> delegate_; |
| 47 | 50 |
| 48 #if defined(USE_X11) | 51 #if defined(USE_X11) |
| 49 // Since display sleep prevention also implies system suspend prevention, for | 52 // Since display sleep prevention also implies system suspend prevention, for |
| 50 // the Linux FreeDesktop API case, there needs to be a second delegate to | 53 // the Linux FreeDesktop API case, there needs to be a second delegate to |
| 51 // block system suspend when screen saver / display sleep is blocked. | 54 // block system suspend when screen saver / display sleep is blocked. |
| 52 scoped_refptr<Delegate> freedesktop_suspend_delegate_; | 55 scoped_refptr<Delegate> freedesktop_suspend_delegate_; |
| 53 #endif | 56 #endif |
| 54 | 57 |
| 58 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; | |
| 59 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; | |
|
hashimoto
2016/05/24 06:02:42
This task runner has nothing to do with files.
How
scottmg
2016/05/24 17:18:03
Done.
| |
| 60 | |
| 55 DISALLOW_COPY_AND_ASSIGN(PowerSaveBlockerImpl); | 61 DISALLOW_COPY_AND_ASSIGN(PowerSaveBlockerImpl); |
| 56 }; | 62 }; |
| 57 | 63 |
| 58 } // namespace content | 64 } // namespace content |
| 59 | 65 |
| 60 #endif // CONTENT_BROWSER_POWER_SAVE_BLOCKER_IMPL_H_ | 66 #endif // CONTENT_BROWSER_POWER_SAVE_BLOCKER_IMPL_H_ |
| OLD | NEW |