[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

japhet at chromium.org japhet at chromium.org
Wed Apr 7 23:31:15 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 746c2fa6b7694bf014a1c11130867020ea55222a
Author: japhet at chromium.org <japhet at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 11 18:32:02 2009 +0000

    2009-11-11  Nate Chapin  <japhet at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            Add methods to KURLGoogle.cpp declared in http://trac.webkit.org/changeset/50784 but not defined when using KURLGoogle.
    
            https://bugs.webkit.org/show_bug.cgi?id=31357
    
            * platform/KURLGoogle.cpp:
            (WebCore::isSchemeFirstChar):
            (WebCore::isSchemeChar):
            (WebCore::KURL::hasPort):
            (WebCore::KURL::removePort):
            (WebCore::protocolIsValid):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50819 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ada3eef..434cb2a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2009-11-11  Nate Chapin  <japhet at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Add methods to KURLGoogle.cpp declared in http://trac.webkit.org/changeset/50784 but not defined when using KURLGoogle.
+
+        https://bugs.webkit.org/show_bug.cgi?id=31357
+
+        * platform/KURLGoogle.cpp:
+        (WebCore::isSchemeFirstChar):
+        (WebCore::isSchemeChar):
+        (WebCore::KURL::hasPort):
+        (WebCore::KURL::removePort):
+        (WebCore::protocolIsValid):
+
 2009-11-11  Brent Fulgham  <bfulgham at webkit.org>
 
         Build fix, no reviewed.
diff --git a/WebCore/platform/KURLGoogle.cpp b/WebCore/platform/KURLGoogle.cpp
index d0aae0c..17b65fa 100644
--- a/WebCore/platform/KURLGoogle.cpp
+++ b/WebCore/platform/KURLGoogle.cpp
@@ -116,6 +116,16 @@ static bool lowerCaseEqualsASCII(const char* begin, const char* end, const char*
     return begin == end && !*str;
 }
 
+static inline bool isSchemeFirstChar(char c)
+{
+    return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
+}
+
+static inline bool isSchemeChar(char c)
+{
+    return isSchemeFirstChar(c) || (c >= '0' && c <= '9') || c == '.' || c == '-' || c == '*';
+}
+
 
 // KURLGooglePrivate -----------------------------------------------------------
 
@@ -426,6 +436,11 @@ bool KURL::isValid() const
     return m_url.m_isValid;
 }
 
+bool KURL::hasPort() const
+{
+    return hostEnd() < pathStart();
+}
+
 bool KURL::protocolInHTTPFamily() const
 {
     return m_url.m_protocolInHTTPFamily;
@@ -580,6 +595,14 @@ void KURL::setHostAndPort(const String& s)
     m_url.replaceComponents(replacements);
 }
 
+void KURL::removePort()
+{
+    if (hasPort()) {
+        String urlWithoutPort = m_url.string().left(hostEnd()) + m_url.string().substring(pathStart());
+        m_url.setUtf8(urlWithoutPort.utf8());
+    }
+}
+
 void KURL::setPort(unsigned short i)
 {
     KURLGooglePrivate::Replacements replacements;
@@ -698,6 +721,18 @@ bool protocolIsJavaScript(const String& url)
     return protocolIs(url, "javascript");
 }
 
+bool protocolIsValid(const String& protocol)
+{
+    if (!isSchemeFirstChar(protocol[0]))
+        return false;
+    unsigned protocolLength = protocol.length();
+    for (unsigned i = 1; i < protocolLength; i++) {
+        if (!isSchemeChar(protocol[i]))
+            return false;
+    }
+    return true;
+}
+
 // We copied the KURL version here on Sept 12, 2008 while doing a WebKit
 // merge.
 // 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list