[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

kbalazs at webkit.org kbalazs at webkit.org
Wed Dec 22 14:22:36 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 8d8acb1a436f957931d529c02121e0e8192a4e15
Author: kbalazs at webkit.org <kbalazs at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 7 12:23:04 2010 +0000

    2010-10-07  Balazs Kelemen  <kbalazs at webkit.org>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            WebKitTestRunner should be portable
            https://bugs.webkit.org/show_bug.cgi?id=45393
    
            Use only the WebKit API for working with urls.
            * WebKitTestRunner/StringFunctions.h:
            (WTR::createWKURL):
            * WebKitTestRunner/TestController.cpp:
            (WTR::blankURL):
            (WTR::TestController::resetStateToConsistentValues):
            (WTR::TestController::didFinishLoadForFrame):
    2010-10-07  Balazs Kelemen  <kbalazs at webkit.org>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            WebKitTestRunner should be portable
            https://bugs.webkit.org/show_bug.cgi?id=45393
    
            Introducing additional URL API.
            * Shared/API/c/WKURL.cpp:
            (WKURLCreateWithUTF8CString):
            (WKURLIsEqual):
            * Shared/API/c/WKURL.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69297 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 63e1c24..7b05fe3 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,16 @@
+2010-10-07  Balazs Kelemen  <kbalazs at webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        WebKitTestRunner should be portable
+        https://bugs.webkit.org/show_bug.cgi?id=45393
+
+        Introducing additional URL API.
+        * Shared/API/c/WKURL.cpp:
+        (WKURLCreateWithUTF8CString):
+        (WKURLIsEqual):
+        * Shared/API/c/WKURL.h:
+
 2010-10-06  Balazs Kelemen  <kbalazs at webkit.org>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit2/Shared/API/c/WKURL.cpp b/WebKit2/Shared/API/c/WKURL.cpp
index 0176223..dbce7d0 100644
--- a/WebKit2/Shared/API/c/WKURL.cpp
+++ b/WebKit2/Shared/API/c/WKURL.cpp
@@ -33,3 +33,13 @@ WKTypeID WKURLGetTypeID()
 {
     return toAPI(WebURL::APIType);
 }
+
+WKURLRef WKURLCreateWithUTF8CString(const char* string)
+{
+    return toAPI(WebURL::create(String::fromUTF8(string)).leakRef());
+}
+
+bool WKURLIsEqual(WKURLRef a, WKURLRef b)
+{
+    return toImpl(a)->string() == toImpl(b)->string();
+}
diff --git a/WebKit2/Shared/API/c/WKURL.h b/WebKit2/Shared/API/c/WKURL.h
index e12f55c..6eb46a1 100644
--- a/WebKit2/Shared/API/c/WKURL.h
+++ b/WebKit2/Shared/API/c/WKURL.h
@@ -34,6 +34,10 @@ extern "C" {
 
 WK_EXPORT WKTypeID WKURLGetTypeID();
 
+WK_EXPORT WKURLRef WKURLCreateWithUTF8CString(const char* string);
+
+WK_EXPORT bool WKURLIsEqual(WKURLRef a, WKURLRef b);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index db0cba0..bd69255 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,18 @@
+2010-10-07  Balazs Kelemen  <kbalazs at webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        WebKitTestRunner should be portable
+        https://bugs.webkit.org/show_bug.cgi?id=45393
+
+        Use only the WebKit API for working with urls.
+        * WebKitTestRunner/StringFunctions.h:
+        (WTR::createWKURL):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::blankURL):
+        (WTR::TestController::resetStateToConsistentValues):
+        (WTR::TestController::didFinishLoadForFrame):
+
 2010-10-07  Carlos Garcia Campos  <cgarcia at igalia.com>
 
         Reviewed by Xan Lopez.
diff --git a/WebKitTools/WebKitTestRunner/StringFunctions.h b/WebKitTools/WebKitTestRunner/StringFunctions.h
index ba048ea..862ddee 100644
--- a/WebKitTools/WebKitTestRunner/StringFunctions.h
+++ b/WebKitTools/WebKitTestRunner/StringFunctions.h
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 University of Szeged. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -28,18 +29,15 @@
 
 #include <JavaScriptCore/JSRetainPtr.h>
 #include <JavaScriptCore/JavaScript.h>
+#include <sstream>
+#include <string>
 #include <WebKit2/WKRetainPtr.h>
 #include <WebKit2/WKString.h>
-#include <WebKit2/WKStringCF.h>
 #include <WebKit2/WKStringPrivate.h>
 #include <WebKit2/WKURL.h>
-#include <WebKit2/WKURLCF.h>
-#include <sstream>
-#include <string>
 #include <wtf/OwnArrayPtr.h>
 #include <wtf/PassOwnArrayPtr.h>
 #include <wtf/Platform.h>
-#include <wtf/RetainPtr.h>
 #include <wtf/Vector.h>
 
 namespace WTR {
@@ -94,27 +92,20 @@ inline std::ostream& operator<<(std::ostream& out, const WKRetainPtr<WKStringRef
     return out << stringRef.get();
 }
 
-// URL Functions
+// URL creation
 
 inline WKURLRef createWKURL(const char* pathOrURL)
 {
-    RetainPtr<CFStringRef> pathOrURLCFString(AdoptCF, CFStringCreateWithCString(0, pathOrURL, kCFStringEncodingUTF8));
-    RetainPtr<CFURLRef> cfURL;
-    if (CFStringHasPrefix(pathOrURLCFString.get(), CFSTR("http://")) || CFStringHasPrefix(pathOrURLCFString.get(), CFSTR("https://")))
-        cfURL.adoptCF(CFURLCreateWithString(0, pathOrURLCFString.get(), 0));
-    else
-#if PLATFORM(WIN)
-        cfURL.adoptCF(CFURLCreateWithFileSystemPath(0, pathOrURLCFString.get(), kCFURLWindowsPathStyle, false));
-#else
-        cfURL.adoptCF(CFURLCreateWithFileSystemPath(0, pathOrURLCFString.get(), kCFURLPOSIXPathStyle, false));
-#endif
-    return WKURLCreateWithCFURL(cfURL.get());
-}
-
-inline WKStringRef copyURLString(WKURLRef url)
-{
-    RetainPtr<CFURLRef> cfURL(AdoptCF, WKURLCopyCFURL(0, url));
-    return WKStringCreateWithCFString(CFURLGetString(cfURL.get()));
+    if (strstr(pathOrURL, "http://") || strstr(pathOrURL, "https") || strstr(pathOrURL, "file://"))
+        return WKURLCreateWithUTF8CString(pathOrURL);
+
+    const char* filePrefix = "file://";
+    static const size_t prefixLength = strlen(filePrefix);
+    size_t length = strlen(pathOrURL);
+    OwnArrayPtr<char> buffer = adoptArrayPtr(new char[length + prefixLength + 1]);
+    strcpy(buffer.get(), filePrefix);
+    strcat(buffer.get(), pathOrURL);
+    return WKURLCreateWithUTF8CString(buffer.get());
 }
 
 } // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp
index 739d405..9608235 100644
--- a/WebKitTools/WebKitTestRunner/TestController.cpp
+++ b/WebKitTools/WebKitTestRunner/TestController.cpp
@@ -34,6 +34,12 @@
 
 namespace WTR {
 
+static WKURLRef blankURL()
+{
+    static staticBlankURL = WKURLCreateWithUTF8CString("about:blank");
+    retun staticBlankURL;
+}
+
 static TestController* controller;
 
 TestController& TestController::shared()
@@ -227,8 +233,7 @@ void TestController::resetStateToConsistentValues()
     // Reset main page back to about:blank
     m_doneResetting = false;
 
-    WKRetainPtr<WKURLRef> url(AdoptWK, createWKURL("about:blank"));
-    WKPageLoadURL(m_mainWebView->page(), url.get());
+    WKPageLoadURL(m_mainWebView->page(), blankURL());
     TestController::runUntil(m_doneResetting);
 }
 
@@ -295,8 +300,7 @@ void TestController::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame)
         return;
 
     WKRetainPtr<WKURLRef> wkURL(AdoptWK, WKFrameCopyURL(frame));
-    WKRetainPtr<WKStringRef> wkURLString(AdoptWK, copyURLString(wkURL.get()));
-    if (!WKStringIsEqualToUTF8CString(wkURLString.get(), "about:blank"))
+    if (!WKURLIsEqual(wkURL.get(), blankURL()))
         return;
 
     m_doneResetting = true;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list