| 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 InspectorInstrumentation::NativeBreakpoint nativeBreakpoint( | 183 InspectorInstrumentation::breakIfNeeded(document(), |
| 184 document(), "Geolocation.getCurrentPosition", true); | 184 "Geolocation.getCurrentPosition"); |
| 185 | 185 |
| 186 GeoNotifier* notifier = | 186 GeoNotifier* notifier = |
| 187 GeoNotifier::create(this, successCallback, errorCallback, options); | 187 GeoNotifier::create(this, successCallback, errorCallback, options); |
| 188 startRequest(notifier); | 188 startRequest(notifier); |
| 189 | 189 |
| 190 m_oneShots.insert(notifier); | 190 m_oneShots.insert(notifier); |
| 191 } | 191 } |
| 192 | 192 |
| 193 int Geolocation::watchPosition(PositionCallback* successCallback, | 193 int Geolocation::watchPosition(PositionCallback* successCallback, |
| 194 PositionErrorCallback* errorCallback, | 194 PositionErrorCallback* errorCallback, |
| 195 const PositionOptions& options) { | 195 const PositionOptions& options) { |
| 196 if (!frame()) | 196 if (!frame()) |
| 197 return 0; | 197 return 0; |
| 198 | 198 |
| 199 reportGeolocationViolation(document()); | 199 reportGeolocationViolation(document()); |
| 200 InspectorInstrumentation::NativeBreakpoint nativeBreakpoint( | 200 InspectorInstrumentation::breakIfNeeded(document(), |
| 201 document(), "Geolocation.watchPosition", true); | 201 "Geolocation.watchPosition"); |
| 202 | 202 |
| 203 GeoNotifier* notifier = | 203 GeoNotifier* notifier = |
| 204 GeoNotifier::create(this, successCallback, errorCallback, options); | 204 GeoNotifier::create(this, successCallback, errorCallback, options); |
| 205 startRequest(notifier); | 205 startRequest(notifier); |
| 206 | 206 |
| 207 int watchID; | 207 int watchID; |
| 208 // Keep asking for the next id until we're given one that we don't already | 208 // Keep asking for the next id until we're given one that we don't already |
| 209 // have. | 209 // have. |
| 210 do { | 210 do { |
| 211 watchID = getExecutionContext()->circularSequentialID(); | 211 watchID = getExecutionContext()->circularSequentialID(); |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 PositionError::kPositionUnavailable, failedToStartServiceErrorMessage); | 554 PositionError::kPositionUnavailable, failedToStartServiceErrorMessage); |
| 555 error->setIsFatal(true); | 555 error->setIsFatal(true); |
| 556 handleError(error); | 556 handleError(error); |
| 557 } | 557 } |
| 558 | 558 |
| 559 void Geolocation::onPermissionConnectionError() { | 559 void Geolocation::onPermissionConnectionError() { |
| 560 onGeolocationPermissionUpdated(mojom::blink::PermissionStatus::DENIED); | 560 onGeolocationPermissionUpdated(mojom::blink::PermissionStatus::DENIED); |
| 561 } | 561 } |
| 562 | 562 |
| 563 } // namespace blink | 563 } // namespace blink |
| OLD | NEW |