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 "config.h" | |
6 #include "modules/wake_lock/WakeLockController.h" | |
7 | |
8 #include "public/platform/modules/wake_lock/WebWakeLockClient.h" | |
9 | |
10 namespace blink { | |
11 | |
12 WakeLockController::WakeLockController(LocalFrame& frame, WebWakeLockClient* cli ent) | |
13 : m_client(client) | |
14 { | |
15 } | |
16 | |
17 // static | |
18 PassOwnPtrWillBeRawPtr<WakeLockController> WakeLockController::create(LocalFrame & frame, WebWakeLockClient* client) | |
mlamouri (slow - plz ping)
2015/05/05 13:45:44
You only use this method in ::provideTo(). It seem
| |
19 { | |
20 return adoptPtrWillBeNoop(new WakeLockController(frame, client)); | |
21 } | |
22 | |
23 // static | |
24 const char* WakeLockController::supplementName() | |
25 { | |
26 return "WakeLockController"; | |
27 } | |
28 | |
29 // static | |
30 WakeLockController* WakeLockController::from(LocalFrame* frame) | |
31 { | |
32 return static_cast<WakeLockController*>(WillBeHeapSupplement<LocalFrame>::fr om(frame, supplementName())); | |
33 } | |
34 | |
35 // static | |
36 void WakeLockController::provideTo(LocalFrame& frame, WebWakeLockClient* client) | |
37 { | |
38 WillBeHeapSupplement<LocalFrame>::provideTo(frame, WakeLockController::suppl ementName(), WakeLockController::create(frame, client)); | |
mlamouri (slow - plz ping)
2015/05/05 13:45:44
Could you add an ASSERT() checking that RuntimeEna
| |
39 } | |
40 | |
41 void WakeLockController::requestKeepScreenAwake(bool keepScreenAwake) | |
42 { | |
43 if (m_client) { | |
44 m_client->requestKeepScreenAwake(keepScreenAwake); | |
mlamouri (slow - plz ping)
2015/05/05 13:45:44
It seems that you will have problems when the fram
alogvinov
2015/05/06 09:12:34
Could you please elaborate? It seems that e.g. Geo
mlamouri (slow - plz ping)
2015/05/06 10:03:42
Geolocation.cpp will do early returns if there is
| |
45 } | |
mlamouri (slow - plz ping)
2015/05/05 13:45:44
nit: no need for {}
| |
46 } | |
47 | |
48 } // namespace blink | |
OLD | NEW |