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

Side by Side Diff: third_party/WebKit/Source/modules/geolocation/GeoNotifier.cpp

Issue 2191533003: Refactor Timer classes in preparation for landing FrameTimers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More build fixes Created 4 years, 4 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 // 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 #include "modules/geolocation/GeoNotifier.h" 5 #include "modules/geolocation/GeoNotifier.h"
6 6
7 #include "modules/geolocation/Geolocation.h" 7 #include "modules/geolocation/Geolocation.h"
8 #include "modules/geolocation/PositionError.h" 8 #include "modules/geolocation/PositionError.h"
9 #include "modules/geolocation/PositionOptions.h" 9 #include "modules/geolocation/PositionOptions.h"
10 #include "platform/Histogram.h" 10 #include "platform/Histogram.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 void GeoNotifier::startTimer() 69 void GeoNotifier::startTimer()
70 { 70 {
71 m_timer.startOneShot(m_options.timeout() / 1000.0, BLINK_FROM_HERE); 71 m_timer.startOneShot(m_options.timeout() / 1000.0, BLINK_FROM_HERE);
72 } 72 }
73 73
74 void GeoNotifier::stopTimer() 74 void GeoNotifier::stopTimer()
75 { 75 {
76 m_timer.stop(); 76 m_timer.stop();
77 } 77 }
78 78
79 void GeoNotifier::timerFired(Timer<GeoNotifier>*) 79 void GeoNotifier::timerFired(TimerBase*)
80 { 80 {
81 m_timer.stop(); 81 m_timer.stop();
82 82
83 // Test for fatal error first. This is required for the case where the Local Frame is 83 // Test for fatal error first. This is required for the case where the Local Frame is
84 // disconnected and requests are cancelled. 84 // disconnected and requests are cancelled.
85 if (m_fatalError) { 85 if (m_fatalError) {
86 runErrorCallback(m_fatalError); 86 runErrorCallback(m_fatalError);
87 // This will cause this notifier to be deleted. 87 // This will cause this notifier to be deleted.
88 m_geolocation->fatalErrorOccurred(this); 88 m_geolocation->fatalErrorOccurred(this);
89 return; 89 return;
(...skipping 10 matching lines...) Expand all
100 if (m_errorCallback) 100 if (m_errorCallback)
101 m_errorCallback->handleEvent(PositionError::create(PositionError::TIMEOU T, "Timeout expired")); 101 m_errorCallback->handleEvent(PositionError::create(PositionError::TIMEOU T, "Timeout expired"));
102 102
103 DEFINE_STATIC_LOCAL(CustomCountHistogram, timeoutExpiredHistogram, ("Geoloca tion.TimeoutExpired", 0, 1000 * 60 * 10 /* 10 minute max */, 20 /* buckets */)); 103 DEFINE_STATIC_LOCAL(CustomCountHistogram, timeoutExpiredHistogram, ("Geoloca tion.TimeoutExpired", 0, 1000 * 60 * 10 /* 10 minute max */, 20 /* buckets */));
104 timeoutExpiredHistogram.count(m_options.timeout()); 104 timeoutExpiredHistogram.count(m_options.timeout());
105 105
106 m_geolocation->requestTimedOut(this); 106 m_geolocation->requestTimedOut(this);
107 } 107 }
108 108
109 } // namespace blink 109 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698