| 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 "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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // An existing timer may not have a zero timeout. | 49 // An existing timer may not have a zero timeout. |
| 50 timer_.Stop(); | 50 timer_.Stop(); |
| 51 timer_.StartOneShot(0, BLINK_FROM_HERE); | 51 timer_.StartOneShot(0, BLINK_FROM_HERE); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void GeoNotifier::SetUseCachedPosition() { | 54 void GeoNotifier::SetUseCachedPosition() { |
| 55 use_cached_position_ = true; | 55 use_cached_position_ = true; |
| 56 timer_.StartOneShot(0, BLINK_FROM_HERE); | 56 timer_.StartOneShot(0, BLINK_FROM_HERE); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void GeoNotifier::RunSuccessCallback(Geoposition* position) { | 59 void GeoNotifier::RunSuccessCallback(Position* position) { |
| 60 success_callback_->handleEvent(position); | 60 success_callback_->handleEvent(position); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void GeoNotifier::RunErrorCallback(PositionError* error) { | 63 void GeoNotifier::RunErrorCallback(PositionError* error) { |
| 64 if (error_callback_) | 64 if (error_callback_) |
| 65 error_callback_->handleEvent(error); | 65 error_callback_->handleEvent(error); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void GeoNotifier::StartTimer() { | 68 void GeoNotifier::StartTimer() { |
| 69 timer_.StartOneShot(options_.timeout() / 1000.0, BLINK_FROM_HERE); | 69 timer_.StartOneShot(options_.timeout() / 1000.0, BLINK_FROM_HERE); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 99 | 99 |
| 100 DEFINE_STATIC_LOCAL(CustomCountHistogram, timeout_expired_histogram, | 100 DEFINE_STATIC_LOCAL(CustomCountHistogram, timeout_expired_histogram, |
| 101 ("Geolocation.TimeoutExpired", 0, | 101 ("Geolocation.TimeoutExpired", 0, |
| 102 1000 * 60 * 10 /* 10 minute max */, 20 /* buckets */)); | 102 1000 * 60 * 10 /* 10 minute max */, 20 /* buckets */)); |
| 103 timeout_expired_histogram.Count(options_.timeout()); | 103 timeout_expired_histogram.Count(options_.timeout()); |
| 104 | 104 |
| 105 geolocation_->RequestTimedOut(this); | 105 geolocation_->RequestTimedOut(this); |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace blink | 108 } // namespace blink |
| OLD | NEW |