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

Side by Side Diff: Source/modules/battery/BatteryManager.h

Issue 967303002: Remove old & unused BatteryManager::canSuspend() implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BatteryManager_h 5 #ifndef BatteryManager_h
6 #define BatteryManager_h 6 #define BatteryManager_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h" 9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "core/dom/ContextLifecycleObserver.h" 10 #include "core/dom/ContextLifecycleObserver.h"
(...skipping 30 matching lines...) Expand all
41 DEFINE_ATTRIBUTE_EVENT_LISTENER(dischargingtimechange); 41 DEFINE_ATTRIBUTE_EVENT_LISTENER(dischargingtimechange);
42 DEFINE_ATTRIBUTE_EVENT_LISTENER(levelchange); 42 DEFINE_ATTRIBUTE_EVENT_LISTENER(levelchange);
43 43
44 // Inherited from PlatformEventController. 44 // Inherited from PlatformEventController.
45 virtual void didUpdateData() override; 45 virtual void didUpdateData() override;
46 virtual void registerWithDispatcher() override; 46 virtual void registerWithDispatcher() override;
47 virtual void unregisterWithDispatcher() override; 47 virtual void unregisterWithDispatcher() override;
48 virtual bool hasLastData() override; 48 virtual bool hasLastData() override;
49 49
50 // ActiveDOMObject implementation. 50 // ActiveDOMObject implementation.
51 virtual bool canSuspend() const { return true; }
52 virtual void suspend() override; 51 virtual void suspend() override;
53 virtual void resume() override; 52 virtual void resume() override;
54 virtual void stop() override; 53 virtual void stop() override;
55 virtual bool hasPendingActivity() const override; 54 virtual bool hasPendingActivity() const override;
56 55
57 DECLARE_VIRTUAL_TRACE(); 56 DECLARE_VIRTUAL_TRACE();
58 57
59 private: 58 private:
60 enum State { 59 enum State {
61 NotStarted, 60 NotStarted,
62 Pending, 61 Pending,
63 Resolved, 62 Resolved,
64 }; 63 };
65 64
66 explicit BatteryManager(ExecutionContext*); 65 explicit BatteryManager(ExecutionContext*);
67 66
68 RefPtrWillBeMember<ScriptPromiseResolver> m_resolver; 67 RefPtrWillBeMember<ScriptPromiseResolver> m_resolver;
69 Member<BatteryStatus> m_batteryStatus; 68 Member<BatteryStatus> m_batteryStatus;
70 State m_state; 69 State m_state;
71 }; 70 };
72 71
73 } // namespace blink 72 } // namespace blink
74 73
75 #endif // BatteryManager_h 74 #endif // BatteryManager_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698