Changeset 64451 in webkit


Ignore:
Timestamp:
Aug 1, 2010 7:03:18 PM (14 years ago)
Author:
tkent@chromium.org
Message:

2010-08-01 Kent Tamura <tkent@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().
Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r64445 r64451  
     12010-08-01  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        [DRT/Chromium] Remove string_util.h dependency
     6        https://bugs.webkit.org/show_bug.cgi?id=43312
     7
     8        * DumpRenderTree/chromium/LayoutTestController.cpp:
     9        (LayoutTestController::pathToLocalResource):
     10         Use string::find() instead of StartsWithASCII().
     11        (LayoutTestController::cppVariantToInt32):
     12         Use strtol() instead of StringToNumber().
     13
    1142010-08-01  Sam Weinig  <sam@webkit.org>
    215
  • trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp

    r64356 r64451  
    3636#include "TestShell.h"
    3737#include "WebViewHost.h"
    38 #include "base/string_util.h"
    3938#include "public/WebAnimationController.h"
    4039#include "public/WebConsoleMessage.h"
     
    5251#include "public/WebView.h"
    5352#include "webkit/support/webkit_support.h"
     53#include <algorithm>
     54#include <cstdlib>
     55#include <limits>
    5456#include <wtf/text/WTFString.h>
    5557
     
    705707    string url = arguments[0].toString();
    706708#if OS(WINDOWS)
    707     if (StartsWithASCII(url, "/tmp/", true)) {
     709    if (!url.find("/tmp/")) {
    708710        // We want a temp file.
    709711        const unsigned tempPrefixLength = 5;
     
    717719            ASSERT(tempLength < bufferSize);
    718720        }
    719         std::string resultPath(WebString(tempPath.get(), tempLength).utf8());
     721        string resultPath(WebString(tempPath.get(), tempLength).utf8());
    720722        resultPath.append(url.substr(tempPrefixLength));
    721723        result->set(resultPath);
     
    726728    // Some layout tests use file://// which we resolve as a UNC path.  Normalize
    727729    // them to just file:///.
    728     while (StartsWithASCII(url, "file:////", false))
     730    string lowerUrl = url;
     731    transform(lowerUrl.begin(), lowerUrl.end(), lowerUrl.begin(), ::tolower);
     732    while (!lowerUrl.find("file:////")) {
    729733        url = url.substr(0, 8) + url.substr(9);
     734        lowerUrl = lowerUrl.substr(0, 8) + lowerUrl.substr(9);
     735    }
    730736    result->set(webkit_support::RewriteLayoutTestsURL(url).spec());
    731737}
     
    10251031        return value.toInt32();
    10261032    if (value.isString()) {
    1027         int number;
    1028         if (StringToInt(value.toString(), &number))
    1029             return number;
     1033        string stringSource = value.toString();
     1034        const char* source = stringSource.data();
     1035        char* end;
     1036        long number = strtol(source, &end, 10);
     1037        if (end == source + stringSource.length() && number >= numeric_limits<int32_t>::min() && number <= numeric_limits<int32_t>::max())
     1038            return static_cast<int32_t>(number);
    10301039    }
    10311040    logErrorToConsole("Invalid value for preference. Expected integer value.");
Note: See TracChangeset for help on using the changeset viewer.