OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/wake_lock/wake_lock_state.h" |
| 6 |
| 7 namespace content { |
| 8 |
| 9 WakeLockState::WakeLockState() { |
| 10 } |
| 11 |
| 12 WakeLockState::~WakeLockState() { |
| 13 } |
| 14 |
| 15 void WakeLockState::AddFrame(const RenderFrameHost* frame) { |
| 16 frames_requesting_lock_.insert(frame); |
| 17 } |
| 18 |
| 19 void WakeLockState::RemoveFrame(const RenderFrameHost* frame) { |
| 20 frames_requesting_lock_.erase(frame); |
| 21 } |
| 22 |
| 23 void WakeLockState::RemoveAllFrames() { |
| 24 frames_requesting_lock_.clear(); |
| 25 } |
| 26 |
| 27 bool WakeLockState::GetLockState() const { |
| 28 return !frames_requesting_lock_.empty(); |
| 29 } |
| 30 |
| 31 } // namespace content |
OLD | NEW |