Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "core/dom/TaskRunnerHelper.h" | |
| 7 #include "modules/geolocation/Geolocation.h" | 8 #include "modules/geolocation/Geolocation.h" |
| 8 #include "modules/geolocation/PositionError.h" | 9 #include "modules/geolocation/PositionError.h" |
| 9 #include "modules/geolocation/PositionOptions.h" | 10 #include "modules/geolocation/PositionOptions.h" |
| 10 #include "platform/Histogram.h" | 11 #include "platform/Histogram.h" |
| 11 #include "wtf/Assertions.h" | 12 #include "wtf/Assertions.h" |
| 12 | 13 |
| 13 namespace blink { | 14 namespace blink { |
| 14 | 15 |
| 15 GeoNotifier::GeoNotifier(Geolocation* geolocation, | 16 GeoNotifier::GeoNotifier(Geolocation* geolocation, |
| 16 PositionCallback* successCallback, | 17 PositionCallback* successCallback, |
| 17 PositionErrorCallback* errorCallback, | 18 PositionErrorCallback* errorCallback, |
| 18 const PositionOptions& options) | 19 const PositionOptions& options) |
| 19 : m_geolocation(geolocation), | 20 : m_geolocation(geolocation), |
| 20 m_successCallback(successCallback), | 21 m_successCallback(successCallback), |
| 21 m_errorCallback(errorCallback), | 22 m_errorCallback(errorCallback), |
| 22 m_options(options), | 23 m_options(options), |
| 23 m_timer(this, &GeoNotifier::timerFired), | 24 m_timer(TaskRunnerHelper::get(TaskType::Timer, geolocation->frame()), |
|
haraken
2017/01/18 23:30:56
Do you have any spec that says this should use the
| |
| 25 this, | |
| 26 &GeoNotifier::timerFired), | |
| 24 m_useCachedPosition(false) { | 27 m_useCachedPosition(false) { |
| 25 DCHECK(m_geolocation); | 28 DCHECK(m_geolocation); |
| 26 DCHECK(m_successCallback); | 29 DCHECK(m_successCallback); |
| 27 | 30 |
| 28 DEFINE_STATIC_LOCAL(CustomCountHistogram, timeoutHistogram, | 31 DEFINE_STATIC_LOCAL(CustomCountHistogram, timeoutHistogram, |
| 29 ("Geolocation.Timeout", 0, | 32 ("Geolocation.Timeout", 0, |
| 30 1000 * 60 * 10 /* 10 minute max */, 20 /* buckets */)); | 33 1000 * 60 * 10 /* 10 minute max */, 20 /* buckets */)); |
| 31 timeoutHistogram.count(m_options.timeout()); | 34 timeoutHistogram.count(m_options.timeout()); |
| 32 } | 35 } |
| 33 | 36 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 | 102 |
| 100 DEFINE_STATIC_LOCAL(CustomCountHistogram, timeoutExpiredHistogram, | 103 DEFINE_STATIC_LOCAL(CustomCountHistogram, timeoutExpiredHistogram, |
| 101 ("Geolocation.TimeoutExpired", 0, | 104 ("Geolocation.TimeoutExpired", 0, |
| 102 1000 * 60 * 10 /* 10 minute max */, 20 /* buckets */)); | 105 1000 * 60 * 10 /* 10 minute max */, 20 /* buckets */)); |
| 103 timeoutExpiredHistogram.count(m_options.timeout()); | 106 timeoutExpiredHistogram.count(m_options.timeout()); |
| 104 | 107 |
| 105 m_geolocation->requestTimedOut(this); | 108 m_geolocation->requestTimedOut(this); |
| 106 } | 109 } |
| 107 | 110 |
| 108 } // namespace blink | 111 } // namespace blink |
| OLD | NEW |