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

Side by Side Diff: third_party/WebKit/Source/modules/vibration/VibrationController.h

Issue 2629593004: Disambiguate LifecycleObserver::contextDestroyed (Closed)
Patch Set: temp Created 3 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Samsung Electronics 2 * Copyright (C) 2012 Samsung Electronics
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 // Whether a pattern is being processed. If this is true, the vibration 62 // Whether a pattern is being processed. If this is true, the vibration
63 // hardware may currently be active, but during a pause it may be inactive. 63 // hardware may currently be active, but during a pause it may be inactive.
64 bool isRunning() const { return m_isRunning; } 64 bool isRunning() const { return m_isRunning; }
65 65
66 VibrationPattern pattern() const { return m_pattern; } 66 VibrationPattern pattern() const { return m_pattern; }
67 67
68 DECLARE_VIRTUAL_TRACE(); 68 DECLARE_VIRTUAL_TRACE();
69 69
70 private: 70 private:
71 // Inherited from ContextLifecycleObserver AND PageVisibilityObserver. 71 // Inherited from ContextLifecycleObserver and PageVisibilityObserver.
72 void contextDestroyed() override; 72 void contextDestroyed(ExecutionContext*) override;
73 void contextDestroyed(Page*) override;
73 74
74 // Inherited from PageVisibilityObserver. 75 // Inherited from PageVisibilityObserver.
75 void pageVisibilityChanged() override; 76 void pageVisibilityChanged() override;
76 77
77 // The VibrationManager mojo service. This is reset in |contextDestroyed| 78 // The VibrationManager mojo service. This is reset in |contextDestroyed|
78 // and must not be called or recreated after it is reset. 79 // and must not be called or recreated after it is reset.
79 device::blink::VibrationManagerPtr m_service; 80 device::blink::VibrationManagerPtr m_service;
80 81
81 // Timer for calling |doVibrate| after a delay. It is safe to call 82 // Timer for calling |doVibrate| after a delay. It is safe to call
82 // |startOneshot| when the timer is already running: it may affect the time 83 // |startOneshot| when the timer is already running: it may affect the time
83 // at which it fires, but |doVibrate| will still be called only once. 84 // at which it fires, but |doVibrate| will still be called only once.
84 Timer<VibrationController> m_timerDoVibrate; 85 Timer<VibrationController> m_timerDoVibrate;
85 86
86 // Whether a pattern is being processed. The vibration hardware may 87 // Whether a pattern is being processed. The vibration hardware may
87 // currently be active, or during a pause it may be inactive. 88 // currently be active, or during a pause it may be inactive.
88 bool m_isRunning; 89 bool m_isRunning;
89 90
90 // Whether an async mojo call to cancel is pending. 91 // Whether an async mojo call to cancel is pending.
91 bool m_isCallingCancel; 92 bool m_isCallingCancel;
92 93
93 // Whether an async mojo call to vibrate is pending. 94 // Whether an async mojo call to vibrate is pending.
94 bool m_isCallingVibrate; 95 bool m_isCallingVibrate;
95 96
96 VibrationPattern m_pattern; 97 VibrationPattern m_pattern;
97 }; 98 };
98 99
99 } // namespace blink 100 } // namespace blink
100 101
101 #endif // VibrationController_h 102 #endif // VibrationController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698