OSDN Git Service

Fix a few crashes with assertions enabled.
authorPatrick Scott <phanna@android.com>
Tue, 29 Sep 2009 13:43:03 +0000 (09:43 -0400)
committerPatrick Scott <phanna@android.com>
Tue, 29 Sep 2009 15:26:24 +0000 (11:26 -0400)
KURL::protocolIs no longer likes "javascript" and has a different method called
protocolIsJavaScript.

WebCore/platform/android/GeolocationServiceAndroid.cpp
WebCore/platform/graphics/android/FontPlatformData.h
WebKit/android/WebCoreSupport/GeolocationPermissions.cpp
WebKit/android/jni/WebCoreFrameBridge.cpp
WebKit/android/jni/WebSettings.cpp
WebKit/android/nav/CacheBuilder.cpp

index e1d34b0..9dcef6f 100644 (file)
@@ -347,7 +347,7 @@ void GeolocationServiceAndroid::newErrorAvailable(PassRefPtr<PositionError> erro
 }
 
 void GeolocationServiceAndroid::timerFired(Timer<GeolocationServiceAndroid>* timer) {
-    ASSERT(m_timer == timer);
+    ASSERT(&m_timer == timer);
     ASSERT(m_lastPosition || m_lastError);
     if (m_lastPosition)
         positionChanged();
index 56c7827..ce60752 100644 (file)
@@ -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;
index a0b234b..b77edd3 100755 (executable)
@@ -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);
index 6c97acc..2981441 100644 (file)
@@ -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
index 3cba99c..4240dd5 100644 (file)
@@ -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);
             }
         }
index 037a6e5..4acf598 100644 (file)
@@ -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();
         }