From 06f1ecff0f609438be162b71b50a3be08983df23 Mon Sep 17 00:00:00 2001 From: Patrick Scott Date: Tue, 29 Sep 2009 09:43:03 -0400 Subject: [PATCH] Fix a few crashes with assertions enabled. KURL::protocolIs no longer likes "javascript" and has a different method called protocolIsJavaScript. --- WebCore/platform/android/GeolocationServiceAndroid.cpp | 2 +- WebCore/platform/graphics/android/FontPlatformData.h | 8 +++++++- WebKit/android/WebCoreSupport/GeolocationPermissions.cpp | 5 ++++- WebKit/android/jni/WebCoreFrameBridge.cpp | 2 +- WebKit/android/jni/WebSettings.cpp | 2 +- WebKit/android/nav/CacheBuilder.cpp | 2 +- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/WebCore/platform/android/GeolocationServiceAndroid.cpp b/WebCore/platform/android/GeolocationServiceAndroid.cpp index e1d34b0c9..9dcef6fb0 100644 --- a/WebCore/platform/android/GeolocationServiceAndroid.cpp +++ b/WebCore/platform/android/GeolocationServiceAndroid.cpp @@ -347,7 +347,7 @@ void GeolocationServiceAndroid::newErrorAvailable(PassRefPtr erro } void GeolocationServiceAndroid::timerFired(Timer* timer) { - ASSERT(m_timer == timer); + ASSERT(&m_timer == timer); ASSERT(m_lastPosition || m_lastError); if (m_lastPosition) positionChanged(); diff --git a/WebCore/platform/graphics/android/FontPlatformData.h b/WebCore/platform/graphics/android/FontPlatformData.h index 56c78274a..ce6075228 100644 --- a/WebCore/platform/graphics/android/FontPlatformData.h +++ b/WebCore/platform/graphics/android/FontPlatformData.h @@ -25,7 +25,9 @@ #ifndef FontPlatformData_H #define FontPlatformData_H -#include "StringImpl.h" +#ifndef NDEBUG +#include "PlatformString.h" +#endif class SkPaint; class SkTypeface; @@ -59,6 +61,10 @@ public: float size() const { return mTextSize; } unsigned hash() const; +#ifndef NDEBUG + String description() const { return ""; } +#endif + private: SkTypeface* mTypeface; float mTextSize; diff --git a/WebKit/android/WebCoreSupport/GeolocationPermissions.cpp b/WebKit/android/WebCoreSupport/GeolocationPermissions.cpp index a0b234b51..b77edd30e 100755 --- a/WebKit/android/WebCoreSupport/GeolocationPermissions.cpp +++ b/WebKit/android/WebCoreSupport/GeolocationPermissions.cpp @@ -181,7 +181,10 @@ void GeolocationPermissions::cancelPendingRequests(String origin) if (index != WTF::notFound) { // Get the permission from the permanent list. PermissionsMap::const_iterator iter = s_permanentPermissions.find(origin); - ASSERT(iter != (PermissionsMap::const_iterator end = s_permanentPermissions.end())); +#ifndef NDEBUG + PermissionsMap::const_iterator end = s_permanentPermissions.end(); + ASSERT(iter != end); +#endif bool allow = iter->second; maybeCallbackFrames(origin, allow); diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp index 6c97acc64..298144100 100644 --- a/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -637,7 +637,7 @@ WebFrame::canHandleRequest(const WebCore::ResourceRequest& request) if (!mUserInitiatedClick && !request.getUserGesture() && (requestUrl.protocolIs("http") || requestUrl.protocolIs("https") || requestUrl.protocolIs("file") || requestUrl.protocolIs("about") || - requestUrl.protocolIs("javascript"))) + WebCore::protocolIsJavaScript(requestUrl.string()))) return true; WebCore::String url(request.url().string()); // Empty urls should not be sent to java diff --git a/WebKit/android/jni/WebSettings.cpp b/WebKit/android/jni/WebSettings.cpp index 3cba99ce2..4240dd53c 100644 --- a/WebKit/android/jni/WebSettings.cpp +++ b/WebKit/android/jni/WebSettings.cpp @@ -316,7 +316,7 @@ public: str = (jstring)env->GetObjectField(obj, gFieldIds->mAppCachePath); if (str) { WebCore::String path = to_string(env, str); - if (path.length()) { + if (path.length() && WebCore::cacheStorage().cacheDirectory().isNull()) { WebCore::cacheStorage().setCacheDirectory(path); } } diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp index 037a6e52a..4acf59833 100644 --- a/WebKit/android/nav/CacheBuilder.cpp +++ b/WebKit/android/nav/CacheBuilder.cpp @@ -1117,7 +1117,7 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame, hasMouseOver = NodeHasEventListeners(node, &eventNames().mouseoverEvent, 1); isAnchor = true; KURL href = anchorNode->href(); - if (!href.isEmpty() && !href.protocolIs("javascript")) + if (!href.isEmpty() && !WebCore::protocolIsJavaScript(href.string())) // Set the exported string for all non-javascript anchors. exported = href.string().copy(); } -- 2.11.0