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 18 matching lines...) Expand all Loading... |
29 | 29 |
30 #include "core/dom/Document.h" | 30 #include "core/dom/Document.h" |
31 #include "core/frame/Deprecation.h" | 31 #include "core/frame/Deprecation.h" |
32 #include "core/frame/HostsUsingFeatures.h" | 32 #include "core/frame/HostsUsingFeatures.h" |
33 #include "core/frame/Settings.h" | 33 #include "core/frame/Settings.h" |
34 #include "modules/geolocation/Coordinates.h" | 34 #include "modules/geolocation/Coordinates.h" |
35 #include "modules/geolocation/GeolocationError.h" | 35 #include "modules/geolocation/GeolocationError.h" |
36 #include "platform/UserGestureIndicator.h" | 36 #include "platform/UserGestureIndicator.h" |
37 #include "platform/mojo/MojoHelper.h" | 37 #include "platform/mojo/MojoHelper.h" |
38 #include "public/platform/InterfaceProvider.h" | 38 #include "public/platform/InterfaceProvider.h" |
| 39 #include "public/platform/Platform.h" |
39 #include "wtf/Assertions.h" | 40 #include "wtf/Assertions.h" |
40 #include "wtf/CurrentTime.h" | 41 #include "wtf/CurrentTime.h" |
41 | 42 |
42 namespace blink { | 43 namespace blink { |
43 namespace { | 44 namespace { |
44 | 45 |
45 static const char permissionDeniedErrorMessage[] = "User denied Geolocation"; | 46 static const char permissionDeniedErrorMessage[] = "User denied Geolocation"; |
46 static const char failedToStartServiceErrorMessage[] = "Failed to start Geolocat
ion service"; | 47 static const char failedToStartServiceErrorMessage[] = "Failed to start Geolocat
ion service"; |
47 static const char framelessDocumentErrorMessage[] = "Geolocation cannot be used
in frameless documents"; | 48 static const char framelessDocumentErrorMessage[] = "Geolocation cannot be used
in frameless documents"; |
48 | 49 |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 queryNextPosition(); | 519 queryNextPosition(); |
519 } | 520 } |
520 | 521 |
521 void Geolocation::pageVisibilityChanged() | 522 void Geolocation::pageVisibilityChanged() |
522 { | 523 { |
523 updateGeolocationServiceConnection(); | 524 updateGeolocationServiceConnection(); |
524 } | 525 } |
525 | 526 |
526 void Geolocation::onGeolocationConnectionError() | 527 void Geolocation::onGeolocationConnectionError() |
527 { | 528 { |
| 529 // If a request is outstanding at process shutdown, this error handler will |
| 530 // be called. In that case, blink has already shut down so do nothing. |
| 531 // |
| 532 // TODO(sammc): Remove this once renderer shutdown is no longer graceful. |
| 533 if (!Platform::current()) |
| 534 return; |
| 535 |
528 PositionError* error = PositionError::create(PositionError::kPositionUnavail
able, failedToStartServiceErrorMessage); | 536 PositionError* error = PositionError::create(PositionError::kPositionUnavail
able, failedToStartServiceErrorMessage); |
529 error->setIsFatal(true); | 537 error->setIsFatal(true); |
530 handleError(error); | 538 handleError(error); |
531 } | 539 } |
532 | 540 |
533 void Geolocation::onPermissionConnectionError() | 541 void Geolocation::onPermissionConnectionError() |
534 { | 542 { |
| 543 // If a request is outstanding at process shutdown, this error handler will |
| 544 // be called. In that case, blink has already shut down so do nothing. |
| 545 // |
| 546 // TODO(sammc): Remove this once renderer shutdown is no longer graceful. |
| 547 if (!Platform::current()) |
| 548 return; |
| 549 |
535 onGeolocationPermissionUpdated(mojom::blink::PermissionStatus::DENIED); | 550 onGeolocationPermissionUpdated(mojom::blink::PermissionStatus::DENIED); |
536 } | 551 } |
537 | 552 |
538 } // namespace blink | 553 } // namespace blink |
OLD | NEW |