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

Unified Diff: content/browser/wake_lock/wake_lock_service_impl.cc

Issue 1107333002: Wake Lock API implementation (Chromium part) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added visibility check to browsertest Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/wake_lock/wake_lock_service_impl.cc
diff --git a/content/browser/wake_lock/wake_lock_service_impl.cc b/content/browser/wake_lock/wake_lock_service_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..913a13785b17fa7241cbb88f33237c5baa919b87
--- /dev/null
+++ b/content/browser/wake_lock/wake_lock_service_impl.cc
@@ -0,0 +1,33 @@
+// 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_service_impl.h"
+
+#include "content/browser/wake_lock/wake_lock_service_context.h"
+
+namespace content {
+
+WakeLockServiceImpl::WakeLockServiceImpl(
+ base::WeakPtr<WakeLockServiceContext> context,
+ int render_process_id,
+ int render_frame_id,
+ mojo::InterfaceRequest<WakeLockService> request)
+ : context_(context),
+ render_process_id_(render_process_id),
+ render_frame_id_(render_frame_id),
+ binding_(this, request.Pass()) {}
+
+WakeLockServiceImpl::~WakeLockServiceImpl() {}
+
+void WakeLockServiceImpl::RequestWakeLock() {
+ if (context_)
+ context_->RequestWakeLock(render_process_id_, render_frame_id_);
+}
+
+void WakeLockServiceImpl::CancelWakeLock() {
+ if (context_)
+ context_->CancelWakeLock(render_process_id_, render_frame_id_);
+}
+
+} // namespace content
« no previous file with comments | « content/browser/wake_lock/wake_lock_service_impl.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698