| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009 Torch Mobile, Inc. | 3 * Copyright (C) 2009 Torch Mobile, Inc. |
| 4 * Copyright 2010, The Android Open Source Project | 4 * Copyright 2010, The Android Open Source Project |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 | 175 |
| 176 void Geolocation::getCurrentPosition(PositionCallback* successCallback, | 176 void Geolocation::getCurrentPosition(PositionCallback* successCallback, |
| 177 PositionErrorCallback* errorCallback, | 177 PositionErrorCallback* errorCallback, |
| 178 const PositionOptions& options) { | 178 const PositionOptions& options) { |
| 179 if (!frame()) | 179 if (!frame()) |
| 180 return; | 180 return; |
| 181 | 181 |
| 182 reportGeolocationViolation(document()); | 182 reportGeolocationViolation(document()); |
| 183 probe::breakIfNeeded(document(), "Geolocation.getCurrentPosition"); | 183 probe::breakableLocation(document(), "Geolocation.getCurrentPosition"); |
| 184 | 184 |
| 185 GeoNotifier* notifier = | 185 GeoNotifier* notifier = |
| 186 GeoNotifier::create(this, successCallback, errorCallback, options); | 186 GeoNotifier::create(this, successCallback, errorCallback, options); |
| 187 startRequest(notifier); | 187 startRequest(notifier); |
| 188 | 188 |
| 189 m_oneShots.insert(notifier); | 189 m_oneShots.insert(notifier); |
| 190 } | 190 } |
| 191 | 191 |
| 192 int Geolocation::watchPosition(PositionCallback* successCallback, | 192 int Geolocation::watchPosition(PositionCallback* successCallback, |
| 193 PositionErrorCallback* errorCallback, | 193 PositionErrorCallback* errorCallback, |
| 194 const PositionOptions& options) { | 194 const PositionOptions& options) { |
| 195 if (!frame()) | 195 if (!frame()) |
| 196 return 0; | 196 return 0; |
| 197 | 197 |
| 198 reportGeolocationViolation(document()); | 198 reportGeolocationViolation(document()); |
| 199 probe::breakIfNeeded(document(), "Geolocation.watchPosition"); | 199 probe::breakableLocation(document(), "Geolocation.watchPosition"); |
| 200 | 200 |
| 201 GeoNotifier* notifier = | 201 GeoNotifier* notifier = |
| 202 GeoNotifier::create(this, successCallback, errorCallback, options); | 202 GeoNotifier::create(this, successCallback, errorCallback, options); |
| 203 startRequest(notifier); | 203 startRequest(notifier); |
| 204 | 204 |
| 205 int watchID; | 205 int watchID; |
| 206 // Keep asking for the next id until we're given one that we don't already | 206 // Keep asking for the next id until we're given one that we don't already |
| 207 // have. | 207 // have. |
| 208 do { | 208 do { |
| 209 watchID = getExecutionContext()->circularSequentialID(); | 209 watchID = getExecutionContext()->circularSequentialID(); |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 PositionError::kPositionUnavailable, failedToStartServiceErrorMessage); | 552 PositionError::kPositionUnavailable, failedToStartServiceErrorMessage); |
| 553 error->setIsFatal(true); | 553 error->setIsFatal(true); |
| 554 handleError(error); | 554 handleError(error); |
| 555 } | 555 } |
| 556 | 556 |
| 557 void Geolocation::onPermissionConnectionError() { | 557 void Geolocation::onPermissionConnectionError() { |
| 558 onGeolocationPermissionUpdated(mojom::blink::PermissionStatus::DENIED); | 558 onGeolocationPermissionUpdated(mojom::blink::PermissionStatus::DENIED); |
| 559 } | 559 } |
| 560 | 560 |
| 561 } // namespace blink | 561 } // namespace blink |
| OLD | NEW |