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

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

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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 164
165 void VibrationController::didCancel() { 165 void VibrationController::didCancel() {
166 m_isCallingCancel = false; 166 m_isCallingCancel = false;
167 167
168 // A new vibration pattern may have been set while the mojo call for 168 // A new vibration pattern may have been set while the mojo call for
169 // |cancel| was in flight, so kick the timer to let |doVibrate| process the 169 // |cancel| was in flight, so kick the timer to let |doVibrate| process the
170 // pattern. 170 // pattern.
171 m_timerDoVibrate.startOneShot(0, BLINK_FROM_HERE); 171 m_timerDoVibrate.startOneShot(0, BLINK_FROM_HERE);
172 } 172 }
173 173
174 void VibrationController::contextDestroyed() { 174 void VibrationController::contextDestroyed(ExecutionContext*) {
175 cancel(); 175 cancel();
176 176
177 // If the document context was destroyed, never call the mojo service again. 177 // If the document context was destroyed, never call the mojo service again.
178 m_service.reset(); 178 m_service.reset();
179 } 179 }
180 180
181 void VibrationController::contextDestroyed(Page*) {}
182
181 void VibrationController::pageVisibilityChanged() { 183 void VibrationController::pageVisibilityChanged() {
182 if (!page()->isPageVisible()) 184 if (!page()->isPageVisible())
183 cancel(); 185 cancel();
184 } 186 }
185 187
186 DEFINE_TRACE(VibrationController) { 188 DEFINE_TRACE(VibrationController) {
187 ContextLifecycleObserver::trace(visitor); 189 ContextLifecycleObserver::trace(visitor);
188 PageVisibilityObserver::trace(visitor); 190 PageVisibilityObserver::trace(visitor);
189 } 191 }
190 192
191 } // namespace blink 193 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/vibration/VibrationController.h ('k') | third_party/WebKit/Source/modules/vr/VRController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698