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

Side by Side Diff: content/public/browser/power_save_blocker.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
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/browser/power_save_blocker_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PUBLIC_BROWSER_POWER_SAVE_BLOCKER_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_POWER_SAVE_BLOCKER_H_
6 #define CONTENT_PUBLIC_BROWSER_POWER_SAVE_BLOCKER_H_ 6 #define CONTENT_PUBLIC_BROWSER_POWER_SAVE_BLOCKER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "base/memory/ref_counted.h"
12 #include "base/sequenced_task_runner.h"
11 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
12 14
13 namespace content { 15 namespace content {
14 16
15 // A RAII-style class to block the system from entering low-power (sleep) mode. 17 // A RAII-style class to block the system from entering low-power (sleep) mode.
16 // This class is thread-safe; it may be constructed and deleted on any thread. 18 // This class is thread-safe; it may be constructed and deleted on any thread.
17 class CONTENT_EXPORT PowerSaveBlocker { 19 class CONTENT_EXPORT PowerSaveBlocker {
18 public: 20 public:
19 enum PowerSaveBlockerType { 21 enum PowerSaveBlockerType {
20 // Prevent the application from being suspended. On some platforms, apps may 22 // Prevent the application from being suspended. On some platforms, apps may
(...skipping 20 matching lines...) Expand all
41 kReasonOther, 43 kReasonOther,
42 }; 44 };
43 45
44 virtual ~PowerSaveBlocker() = 0; 46 virtual ~PowerSaveBlocker() = 0;
45 47
46 // Pass in the type of power save blocking desired. If multiple types of 48 // Pass in the type of power save blocking desired. If multiple types of
47 // blocking are desired, instantiate one PowerSaveBlocker for each type. 49 // blocking are desired, instantiate one PowerSaveBlocker for each type.
48 // |reason| and |description| (a more-verbose, human-readable justification of 50 // |reason| and |description| (a more-verbose, human-readable justification of
49 // the blocking) may be provided to the underlying system APIs on some 51 // the blocking) may be provided to the underlying system APIs on some
50 // platforms. 52 // platforms.
51 static std::unique_ptr<PowerSaveBlocker> Create( 53 static std::unique_ptr<PowerSaveBlocker> CreateWithTaskRunners(
52 PowerSaveBlockerType type, 54 PowerSaveBlockerType type,
53 Reason reason, 55 Reason reason,
54 const std::string& description); 56 const std::string& description,
57 scoped_refptr<base::SequencedTaskRunner> ui_task_runner,
58 scoped_refptr<base::SequencedTaskRunner> file_task_runner);
55 }; 59 };
56 60
57 } // namespace content 61 } // namespace content
58 62
59 #endif // CONTENT_PUBLIC_BROWSER_POWER_SAVE_BLOCKER_H_ 63 #endif // CONTENT_PUBLIC_BROWSER_POWER_SAVE_BLOCKER_H_
OLDNEW
« no previous file with comments | « content/content_browser.gypi ('k') | content/public/browser/power_save_blocker_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698