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

Unified Diff: device/wake_lock/wake_lock.h

Issue 2921823002: Rationalize WakeLock naming conventions (Closed)
Patch Set: rebase Created 3 years, 6 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
« no previous file with comments | « device/wake_lock/public/interfaces/wake_lock_service.mojom ('k') | device/wake_lock/wake_lock.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/wake_lock/wake_lock.h
diff --git a/device/wake_lock/wake_lock_service_impl.h b/device/wake_lock/wake_lock.h
similarity index 63%
rename from device/wake_lock/wake_lock_service_impl.h
rename to device/wake_lock/wake_lock.h
index 51191a6c1290ecd079173602830ac5ac675d2aea..53c7b3b9874603396503db14c3dd3bc52e9a58af 100644
--- a/device/wake_lock/wake_lock_service_impl.h
+++ b/device/wake_lock/wake_lock.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef DEVICE_WAKE_LOCK_WAKE_LOCK_SERVICE_IMPL_H_
-#define DEVICE_WAKE_LOCK_WAKE_LOCK_SERVICE_IMPL_H_
+#ifndef DEVICE_WAKE_LOCK_WAKE_LOCK_H_
+#define DEVICE_WAKE_LOCK_WAKE_LOCK_H_
#include <memory>
@@ -11,30 +11,29 @@
#include "base/memory/ref_counted.h"
#include "base/single_thread_task_runner.h"
#include "device/power_save_blocker/power_save_blocker.h"
+#include "device/wake_lock/public/interfaces/wake_lock.mojom.h"
#include "device/wake_lock/public/interfaces/wake_lock_context.mojom.h"
-#include "device/wake_lock/public/interfaces/wake_lock_service.mojom.h"
-#include "device/wake_lock/wake_lock_service_context.h"
+#include "device/wake_lock/wake_lock_context.h"
#include "mojo/public/cpp/bindings/binding_set.h"
#include "ui/gfx/native_widget_types.h"
namespace device {
-class WakeLockServiceImpl : public mojom::WakeLockService {
+class WakeLock : public mojom::WakeLock {
public:
- WakeLockServiceImpl(
- mojom::WakeLockServiceRequest request,
- mojom::WakeLockType type,
- mojom::WakeLockReason reason,
- const std::string& description,
- int context_id,
- WakeLockContextCallback native_view_getter,
- scoped_refptr<base::SingleThreadTaskRunner> file_task_runner);
- ~WakeLockServiceImpl() override;
+ WakeLock(mojom::WakeLockRequest request,
+ mojom::WakeLockType type,
+ mojom::WakeLockReason reason,
+ const std::string& description,
+ int context_id,
+ WakeLockContextCallback native_view_getter,
+ scoped_refptr<base::SingleThreadTaskRunner> file_task_runner);
+ ~WakeLock() override;
// WakeLockSevice implementation.
void RequestWakeLock() override;
void CancelWakeLock() override;
- void AddClient(mojom::WakeLockServiceRequest request) override;
+ void AddClient(mojom::WakeLockRequest request) override;
void HasWakeLockForTests(HasWakeLockForTestsCallback callback) override;
protected:
@@ -63,15 +62,15 @@ class WakeLockServiceImpl : public mojom::WakeLockService {
std::unique_ptr<PowerSaveBlocker> wake_lock_;
// Multiple clients that associate to the same WebContents share the same one
- // WakeLockServiceImpl instance. Two consecutive |RequestWakeLock| requests
+ // WakeLock instance. Two consecutive |RequestWakeLock| requests
// from the same client should be coalesced as one request. Everytime a new
// client is being added into the BindingSet, we create an unique_ptr<bool>
// as its context, which records this client's request status.
- mojo::BindingSet<mojom::WakeLockService, std::unique_ptr<bool>> binding_set_;
+ mojo::BindingSet<mojom::WakeLock, std::unique_ptr<bool>> binding_set_;
- DISALLOW_COPY_AND_ASSIGN(WakeLockServiceImpl);
+ DISALLOW_COPY_AND_ASSIGN(WakeLock);
};
} // namespace device
-#endif // DEVICE_WAKE_LOCK_WAKE_LOCK_SERVICE_IMPL_H_
+#endif // DEVICE_WAKE_LOCK_WAKE_LOCK_H_
« no previous file with comments | « device/wake_lock/public/interfaces/wake_lock_service.mojom ('k') | device/wake_lock/wake_lock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698