OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "content/browser/power_save_blocker_impl.h" | 5 #include "device/power_save_blocker/power_save_blocker_impl.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 | 9 |
10 namespace content { | 10 namespace device { |
11 | 11 |
12 // TODO(derat): Consider renaming this file; '_ozone' is a misnomer as power | 12 // TODO(derat): Consider renaming this file; '_ozone' is a misnomer as power |
13 // save is OS-specific, not display-system-specific. This implementation | 13 // save is OS-specific, not display-system-specific. This implementation |
14 // ends up being used for non-ChromeOS Ozone platforms such as Chromecast. | 14 // ends up being used for non-ChromeOS Ozone platforms such as Chromecast. |
15 // See crbug.com/495661 for more detail. | 15 // See crbug.com/495661 for more detail. |
16 class PowerSaveBlockerImpl::Delegate | 16 class PowerSaveBlockerImpl::Delegate |
17 : public base::RefCountedThreadSafe<PowerSaveBlockerImpl::Delegate> { | 17 : public base::RefCountedThreadSafe<PowerSaveBlockerImpl::Delegate> { |
18 public: | 18 public: |
19 Delegate() {} | 19 Delegate() {} |
20 | 20 |
21 private: | 21 private: |
22 friend class base::RefCountedThreadSafe<Delegate>; | 22 friend class base::RefCountedThreadSafe<Delegate>; |
23 virtual ~Delegate() {} | 23 virtual ~Delegate() {} |
24 | 24 |
25 DISALLOW_COPY_AND_ASSIGN(Delegate); | 25 DISALLOW_COPY_AND_ASSIGN(Delegate); |
26 }; | 26 }; |
27 | 27 |
28 PowerSaveBlockerImpl::PowerSaveBlockerImpl( | 28 PowerSaveBlockerImpl::PowerSaveBlockerImpl( |
29 PowerSaveBlockerType type, | 29 PowerSaveBlockerType type, |
30 Reason reason, | 30 Reason reason, |
31 const std::string& description, | 31 const std::string& description, |
32 scoped_refptr<base::SequencedTaskRunner> ui_task_runner, | 32 scoped_refptr<base::SequencedTaskRunner> ui_task_runner, |
33 scoped_refptr<base::SingleThreadTaskRunner> blocking_task_runner) | 33 scoped_refptr<base::SingleThreadTaskRunner> blocking_task_runner) |
34 : delegate_(new Delegate()), | 34 : delegate_(new Delegate()), |
35 ui_task_runner_(ui_task_runner), | 35 ui_task_runner_(ui_task_runner), |
36 blocking_task_runner_(blocking_task_runner) {} | 36 blocking_task_runner_(blocking_task_runner) {} |
37 | 37 |
38 PowerSaveBlockerImpl::~PowerSaveBlockerImpl() { } | 38 PowerSaveBlockerImpl::~PowerSaveBlockerImpl() {} |
39 | 39 |
40 } // namespace content | 40 } // namespace device |
OLD | NEW |