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

Side by Side Diff: third_party/WebKit/Source/modules/vibration/NavigatorVibration.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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 148 }
149 } 149 }
150 150
151 VibrationController* NavigatorVibration::controller(const LocalFrame& frame) { 151 VibrationController* NavigatorVibration::controller(const LocalFrame& frame) {
152 if (!m_controller) 152 if (!m_controller)
153 m_controller = new VibrationController(*frame.document()); 153 m_controller = new VibrationController(*frame.document());
154 154
155 return m_controller.get(); 155 return m_controller.get();
156 } 156 }
157 157
158 void NavigatorVibration::contextDestroyed() { 158 void NavigatorVibration::contextDestroyed(ExecutionContext*) {
159 if (m_controller) { 159 if (m_controller) {
160 m_controller->cancel(); 160 m_controller->cancel();
161 m_controller = nullptr; 161 m_controller = nullptr;
162 } 162 }
163 } 163 }
164 164
165 DEFINE_TRACE(NavigatorVibration) { 165 DEFINE_TRACE(NavigatorVibration) {
166 visitor->trace(m_controller); 166 visitor->trace(m_controller);
167 Supplement<Navigator>::trace(visitor); 167 Supplement<Navigator>::trace(visitor);
168 ContextLifecycleObserver::trace(visitor); 168 ContextLifecycleObserver::trace(visitor);
169 } 169 }
170 170
171 } // namespace blink 171 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698