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

Unified Diff: device/wake_lock/wake_lock_provider.cc

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/wake_lock_provider.h ('k') | device/wake_lock/wake_lock_service_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/wake_lock/wake_lock_provider.cc
diff --git a/device/wake_lock/wake_lock_provider.cc b/device/wake_lock/wake_lock_provider.cc
index b06208fad7b1756c219c98fce8147d42624af7cf..26e4aa191648d3140f9b73b9dda1fbcd3f59c8e9 100644
--- a/device/wake_lock/wake_lock_provider.cc
+++ b/device/wake_lock/wake_lock_provider.cc
@@ -6,13 +6,13 @@
#include <utility>
-#include "device/wake_lock/wake_lock_service_impl.h"
-#include "device/wake_lock/wake_lock_service_impl_for_testing.h"
+#include "device/wake_lock/wake_lock.h"
+#include "device/wake_lock/wake_lock_for_testing.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
namespace device {
-bool WakeLockProvider::is_in_service_unittest_ = false;
+bool WakeLockProvider::is_in_unittest_ = false;
// static
void WakeLockProvider::Create(
@@ -37,8 +37,8 @@ void WakeLockProvider::GetWakeLockContextForID(
mojo::InterfaceRequest<mojom::WakeLockContext> request) {
DCHECK(context_id >= 0);
mojo::MakeStrongBinding(
- base::MakeUnique<WakeLockServiceContext>(context_id, file_task_runner_,
- native_view_getter_),
+ base::MakeUnique<WakeLockContext>(context_id, file_task_runner_,
+ native_view_getter_),
std::move(request));
}
@@ -46,18 +46,17 @@ void WakeLockProvider::GetWakeLockWithoutContext(
mojom::WakeLockType type,
mojom::WakeLockReason reason,
const std::string& description,
- mojom::WakeLockServiceRequest request) {
- if (is_in_service_unittest_) {
- // Create WakeLockServiceImplForTesting.
- new WakeLockServiceImplForTesting(
- std::move(request), type, reason, description,
- WakeLockServiceContext::WakeLockInvalidContextId, native_view_getter_,
- file_task_runner_);
+ mojom::WakeLockRequest request) {
+ if (is_in_unittest_) {
+ // Create WakeLockForTesting.
+ new WakeLockForTesting(std::move(request), type, reason, description,
+ WakeLockContext::WakeLockInvalidContextId,
+ native_view_getter_, file_task_runner_);
} else {
- // WakeLockServiceImpl owns itself.
- new WakeLockServiceImpl(std::move(request), type, reason, description,
- WakeLockServiceContext::WakeLockInvalidContextId,
- native_view_getter_, file_task_runner_);
+ // WakeLock owns itself.
+ new WakeLock(std::move(request), type, reason, description,
+ WakeLockContext::WakeLockInvalidContextId, native_view_getter_,
+ file_task_runner_);
}
}
« no previous file with comments | « device/wake_lock/wake_lock_provider.h ('k') | device/wake_lock/wake_lock_service_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698