Index: content/browser/wake_lock/wake_lock_state.cc |
diff --git a/content/browser/wake_lock/wake_lock_state.cc b/content/browser/wake_lock/wake_lock_state.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f54e454422d30f6d91520b297f005d927331fc43 |
--- /dev/null |
+++ b/content/browser/wake_lock/wake_lock_state.cc |
@@ -0,0 +1,31 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/browser/wake_lock/wake_lock_state.h" |
+ |
+namespace content { |
+ |
+WakeLockState::WakeLockState() { |
+} |
+ |
+WakeLockState::~WakeLockState() { |
+} |
+ |
+void WakeLockState::AddFrame(const RenderFrameHost* frame) { |
+ frames_requesting_lock_.insert(frame); |
+} |
+ |
+void WakeLockState::RemoveFrame(const RenderFrameHost* frame) { |
+ frames_requesting_lock_.erase(frame); |
+} |
+ |
+void WakeLockState::RemoveAllFrames() { |
+ frames_requesting_lock_.clear(); |
+} |
+ |
+bool WakeLockState::GetLockState() const { |
+ return !frames_requesting_lock_.empty(); |
+} |
+ |
+} // namespace content |