OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_WAKE_LOCK_WAKE_LOCK_SERVICE_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_CONTEXT_H_ |
6 #define CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_CONTEXT_H_ | 6 #define CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_CONTEXT_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <set> | 9 #include <set> |
9 #include <utility> | 10 #include <utility> |
10 | 11 |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "content/browser/wake_lock/wake_lock_service_impl.h" | 14 #include "content/browser/wake_lock/wake_lock_service_impl.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "content/public/browser/web_contents_observer.h" | 16 #include "content/public/browser/web_contents_observer.h" |
17 #include "mojo/public/cpp/bindings/interface_request.h" | 17 #include "mojo/public/cpp/bindings/interface_request.h" |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 class PowerSaveBlocker; | 21 class PowerSaveBlocker; |
22 class RenderFrameHost; | 22 class RenderFrameHost; |
(...skipping 26 matching lines...) Expand all Loading... |
49 private: | 49 private: |
50 void CreateWakeLock(); | 50 void CreateWakeLock(); |
51 void RemoveWakeLock(); | 51 void RemoveWakeLock(); |
52 void UpdateWakeLock(); | 52 void UpdateWakeLock(); |
53 | 53 |
54 // Set of (render_process_id, render_frame_id) pairs identifying all | 54 // Set of (render_process_id, render_frame_id) pairs identifying all |
55 // RenderFrames requesting wake lock. | 55 // RenderFrames requesting wake lock. |
56 std::set<std::pair<int, int>> frames_requesting_lock_; | 56 std::set<std::pair<int, int>> frames_requesting_lock_; |
57 | 57 |
58 // The actual power save blocker for screen. | 58 // The actual power save blocker for screen. |
59 scoped_ptr<PowerSaveBlocker> wake_lock_; | 59 std::unique_ptr<PowerSaveBlocker> wake_lock_; |
60 | 60 |
61 base::WeakPtrFactory<WakeLockServiceContext> weak_factory_; | 61 base::WeakPtrFactory<WakeLockServiceContext> weak_factory_; |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(WakeLockServiceContext); | 63 DISALLOW_COPY_AND_ASSIGN(WakeLockServiceContext); |
64 }; | 64 }; |
65 | 65 |
66 } // namespace content | 66 } // namespace content |
67 | 67 |
68 #endif // CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_CONTEXT_H_ | 68 #endif // CONTENT_BROWSER_WAKE_LOCK_WAKE_LOCK_SERVICE_CONTEXT_H_ |
OLD | NEW |