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

Side by Side Diff: content/browser/power_save_blocker_impl.h

Issue 1991593002: Pass SequencedTaskRunner to PowerSaveBlocker for ui/file operations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@device-power-save-blocker
Patch Set: mac Created 4 years, 7 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 unified diff | Download patch
OLDNEW
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> blocking_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
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> blocking_task_runner_;
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_
OLDNEW
« no previous file with comments | « content/browser/power_save_blocker_factory.cc ('k') | content/browser/power_save_blocker_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698