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

tkent at chromium.org tkent at chromium.org
Wed Dec 22 11:38:17 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 0bcb8b7a07bf444606f8ad280e931f89590dde73
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Aug 2 02:03:18 2010 +0000

    2010-08-01  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            [DRT/Chromium] Remove string_util.h dependency
            https://bugs.webkit.org/show_bug.cgi?id=43312
    
            * DumpRenderTree/chromium/LayoutTestController.cpp:
            (LayoutTestController::pathToLocalResource):
             Use string::find() instead of StartsWithASCII().
            (LayoutTestController::cppVariantToInt32):
             Use strtol() instead of StringToNumber().
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64451 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 92f2e76..bf78ea5 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,16 @@
+2010-08-01  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        [DRT/Chromium] Remove string_util.h dependency
+        https://bugs.webkit.org/show_bug.cgi?id=43312
+
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::pathToLocalResource):
+         Use string::find() instead of StartsWithASCII().
+        (LayoutTestController::cppVariantToInt32):
+         Use strtol() instead of StringToNumber().
+
 2010-08-01  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Anders Carlsson.
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
index 806bb8e..cd27c18 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -35,7 +35,6 @@
 #include "DRTDevToolsAgent.h"
 #include "TestShell.h"
 #include "WebViewHost.h"
-#include "base/string_util.h"
 #include "public/WebAnimationController.h"
 #include "public/WebConsoleMessage.h"
 #include "public/WebDocument.h"
@@ -51,6 +50,9 @@
 #include "public/WebURL.h"
 #include "public/WebView.h"
 #include "webkit/support/webkit_support.h"
+#include <algorithm>
+#include <cstdlib>
+#include <limits>
 #include <wtf/text/WTFString.h>
 
 #if OS(WINDOWS)
@@ -704,7 +706,7 @@ void LayoutTestController::pathToLocalResource(const CppArgumentList& arguments,
 
     string url = arguments[0].toString();
 #if OS(WINDOWS)
-    if (StartsWithASCII(url, "/tmp/", true)) {
+    if (!url.find("/tmp/")) {
         // We want a temp file.
         const unsigned tempPrefixLength = 5;
         size_t bufferSize = MAX_PATH;
@@ -716,7 +718,7 @@ void LayoutTestController::pathToLocalResource(const CppArgumentList& arguments,
             tempLength = GetTempPathW(bufferSize, tempPath.get());
             ASSERT(tempLength < bufferSize);
         }
-        std::string resultPath(WebString(tempPath.get(), tempLength).utf8());
+        string resultPath(WebString(tempPath.get(), tempLength).utf8());
         resultPath.append(url.substr(tempPrefixLength));
         result->set(resultPath);
         return;
@@ -725,8 +727,12 @@ void LayoutTestController::pathToLocalResource(const CppArgumentList& arguments,
 
     // Some layout tests use file://// which we resolve as a UNC path.  Normalize
     // them to just file:///.
-    while (StartsWithASCII(url, "file:////", false))
+    string lowerUrl = url;
+    transform(lowerUrl.begin(), lowerUrl.end(), lowerUrl.begin(), ::tolower);
+    while (!lowerUrl.find("file:////")) {
         url = url.substr(0, 8) + url.substr(9);
+        lowerUrl = lowerUrl.substr(0, 8) + lowerUrl.substr(9);
+    }
     result->set(webkit_support::RewriteLayoutTestsURL(url).spec());
 }
 
@@ -1024,9 +1030,12 @@ int32_t LayoutTestController::cppVariantToInt32(const CppVariant& value)
     if (value.isInt32())
         return value.toInt32();
     if (value.isString()) {
-        int number;
-        if (StringToInt(value.toString(), &number))
-            return number;
+        string stringSource = value.toString();
+        const char* source = stringSource.data();
+        char* end;
+        long number = strtol(source, &end, 10);
+        if (end == source + stringSource.length() && number >= numeric_limits<int32_t>::min() && number <= numeric_limits<int32_t>::max())
+            return static_cast<int32_t>(number);
     }
     logErrorToConsole("Invalid value for preference. Expected integer value.");
     return 0;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list