diff options
author | Steve Block <steveblock@google.com> | 2009-08-12 17:26:45 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-08-14 16:48:08 +0100 |
commit | 5343011d8c5e322c74a78385633354ca3db92343 (patch) | |
tree | 15c11f751fc8de1c0863e4ddfcfefce5021b5004 /WebCore | |
parent | e631646ae9030296d7c00c2298031aa01040351d (diff) | |
download | external_webkit-5343011d8c5e322c74a78385633354ca3db92343.zip external_webkit-5343011d8c5e322c74a78385633354ca3db92343.tar.gz external_webkit-5343011d8c5e322c74a78385633354ca3db92343.tar.bz2 |
do not merge: cherry-picked 360742dd52ce2e67f08b219c5148577ce2e2b741 from master branch
When Geolocation permissions are denied, terminate all watchers as well as one-shots.
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/page/Geolocation.cpp | 4 | ||||
-rw-r--r-- | WebCore/page/PositionError.h | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp index 5421eaa..7fa3a6d 100644 --- a/WebCore/page/Geolocation.cpp +++ b/WebCore/page/Geolocation.cpp @@ -190,6 +190,7 @@ void Geolocation::setIsAllowed(bool allowed) makeSuccessCallbacks(); } else { WTF::RefPtr<WebCore::PositionError> error = PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage); + error->setIsFatal(true); handleError(error.get()); } } @@ -291,6 +292,9 @@ void Geolocation::handleError(PositionError* error) sendErrorToWatchers(error); m_oneShots.clear(); + + if (error->isFatal()) + m_watchers.clear(); } void Geolocation::requestPermission() diff --git a/WebCore/page/PositionError.h b/WebCore/page/PositionError.h index 1d31f3b..c309061 100644 --- a/WebCore/page/PositionError.h +++ b/WebCore/page/PositionError.h @@ -45,16 +45,22 @@ public: ErrorCode code() const { return m_code; } const String& message() const { return m_message; } + void setIsFatal(bool isFatal) { m_isFatal = isFatal; } + bool isFatal() { return m_isFatal; } private: PositionError(ErrorCode code, const String& message) : m_code(code) , m_message(message) + , m_isFatal(false) { } ErrorCode m_code; String m_message; + // Whether the error is fatal, such that no request can ever obtain a good + // position fix in the future. + bool m_isFatal; }; } // namespace WebCore |