Commit 78805507 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

Remove WTF_USE_GOOGLEURL-guarded code

https://bugs.webkit.org/show_bug.cgi?id=114028

Patch by Zan Dobersek <zdobersek@igalia.com> on 2013-04-05
Reviewed by Ryosuke Niwa.

Source/WebCore:

The only remaining usage of the USE(GOOGLEURL) guards is in LinkHashChromium.cpp that will
get removed when purging the Source/WebCore/platform/chromium directory.

* config.h: Remove the define that was Chromium-specific.
* platform/KURL.cpp:
(WebCore):
(WebCore::KURL::reportMemoryUsage):
(WebCore::KURL::isSafeToSendToAnotherThread):
* platform/KURL.h:
(KURL):
* platform/KURLGoogle.cpp: Removed.
* platform/KURLGooglePrivate.h: Removed.

Source/WebKit/blackberry:

* WebCoreSupport/AboutDataUseFeatures.in: Remove GOOGLEURL from the list.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147766 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 50d1bc7d
2013-04-05 Zan Dobersek <zdobersek@igalia.com>
Remove WTF_USE_GOOGLEURL-guarded code
https://bugs.webkit.org/show_bug.cgi?id=114028
Reviewed by Ryosuke Niwa.
The only remaining usage of the USE(GOOGLEURL) guards is in LinkHashChromium.cpp that will
get removed when purging the Source/WebCore/platform/chromium directory.
* config.h: Remove the define that was Chromium-specific.
* platform/KURL.cpp:
(WebCore):
(WebCore::KURL::reportMemoryUsage):
(WebCore::KURL::isSafeToSendToAnotherThread):
* platform/KURL.h:
(KURL):
* platform/KURLGoogle.cpp: Removed.
* platform/KURLGooglePrivate.h: Removed.
2013-04-05 Bem Jones-Bey <bjonesbe@adobe.com>
 
[regression] Security: Heap-use-after-free in WebCore::RenderBlock::logicalRightOffsetForLine
......@@ -127,8 +127,6 @@
// this define is required.
#define WTF_CHANGES 1
#define WTF_USE_GOOGLEURL 1
#endif /* PLATFORM(CHROMIUM) */
#if USE(CG)
......
......@@ -65,8 +65,6 @@ static inline bool isLetterMatchIgnoringCase(UChar character, char lowercaseLett
return (character | 0x20) == lowercaseLetter;
}
#if !USE(GOOGLEURL)
static const char wsScheme[] = {'w', 's'};
static const char ftpScheme[] = {'f', 't', 'p'};
static const char ftpPort[] = {'2', '1'};
......@@ -1716,8 +1714,6 @@ void KURL::print() const
}
#endif
#endif // !USE(GOOGLEURL)
String KURL::strippedForUseAsReferrer() const
{
KURL referrer(*this);
......@@ -1903,20 +1899,12 @@ String mimeTypeFromURL(const KURL& url)
void KURL::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
MemoryClassInfo info(memoryObjectInfo, this);
#if USE(GOOGLEURL)
info.addMember(m_url, "url");
#else // !USE(GOOGLEURL)
info.addMember(m_string, "string");
#endif
}
bool KURL::isSafeToSendToAnotherThread() const
{
#if USE(GOOGLEURL)
return m_url.isSafeToSendToAnotherThread();
#else // !USE(GOOGLEURL)
return m_string.isSafeToSendToAnotherThread();
#endif
}
String KURL::elidedString() const
......
......@@ -44,10 +44,6 @@ class QUrl;
QT_END_NAMESPACE
#endif
#if USE(GOOGLEURL)
#include "KURLGooglePrivate.h"
#endif
namespace WebCore {
class TextEncoding;
......@@ -64,11 +60,7 @@ public:
// KURL object, or indiscernible from such.
// It is usually best to avoid repeatedly parsing a string, unless memory saving outweigh the possible slow-downs.
KURL(ParsedURLStringTag, const String&);
#if USE(GOOGLEURL)
explicit KURL(WTF::HashTableDeletedValueType) : m_url(WTF::HashTableDeletedValue) { }
#else
explicit KURL(WTF::HashTableDeletedValueType) : m_string(WTF::HashTableDeletedValue) { }
#endif
bool isHashTableDeletedValue() const { return string().isHashTableDeletedValue(); }
// Resolves the relative URL with the given base URL. If provided, the
......@@ -81,13 +73,6 @@ public:
KURL(const KURL& base, const String& relative);
KURL(const KURL& base, const String& relative, const TextEncoding&);
#if USE(GOOGLEURL)
// For conversions from other structures that have already parsed and
// canonicalized the URL. The input must be exactly what KURL would have
// done with the same input.
KURL(const CString& canonicalSpec, const url_parse::Parsed&, bool isValid);
#endif
String strippedForUseAsReferrer() const;
// FIXME: The above functions should be harmonized so that passing a
......@@ -115,11 +100,7 @@ public:
bool canSetPathname() const { return isHierarchical(); }
bool isHierarchical() const;
#if USE(GOOGLEURL)
const String& string() const { return m_url.string(); }
#else
const String& string() const { return m_string; }
#endif
String elidedString() const;
......@@ -202,18 +183,7 @@ public:
operator QUrl() const;
#endif
#if USE(GOOGLEURL)
// Getters for the parsed structure and its corresponding 8-bit string.
const url_parse::Parsed& parsed() const { return m_url.m_parsed; }
const CString& utf8String() const { return m_url.utf8String(); }
#endif
#if USE(GOOGLEURL)
const KURL* innerURL() const { return m_url.innerURL(); }
#else
const KURL* innerURL() const { return 0; }
#endif
#ifndef NDEBUG
void print() const;
......@@ -225,10 +195,6 @@ public:
private:
void invalidate();
static bool protocolIs(const String&, const char*);
#if USE(GOOGLEURL)
friend class KURLGooglePrivate;
KURLGooglePrivate m_url;
#else // !USE(GOOGLEURL)
void init(const KURL&, const String&, const TextEncoding&);
void copyToBuffer(Vector<char, 512>& buffer) const;
......@@ -252,7 +218,6 @@ private:
int m_pathEnd;
int m_queryEnd;
int m_fragmentEnd;
#endif
};
bool operator==(const KURL&, const KURL&);
......@@ -323,8 +288,6 @@ inline bool operator!=(const String& a, const KURL& b)
return a != b.string();
}
#if !USE(GOOGLEURL)
// Inline versions of some non-GoogleURL functions so we can get inlining
// without having to have a lot of ugly ifdefs in the class definition.
......@@ -383,8 +346,6 @@ inline unsigned KURL::pathAfterLastSlash() const
return m_pathAfterLastSlash;
}
#endif // !USE(GOOGLEURL)
} // namespace WebCore
namespace WTF {
......
This diff is collapsed.
/*
* Copyright (c) 2008, 2009, 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef KURLGooglePrivate_h
#define KURLGooglePrivate_h
#include <wtf/Forward.h>
#include <wtf/OwnPtr.h>
#include <wtf/text/CString.h>
#include <googleurl/src/url_parse.h>
#include <googleurl/src/url_canon.h>
namespace WebCore {
class KURL;
class TextEncoding;
// Wraps the internals related to using Google-URL as the backend for KURL.
// This maintains the state and has auxiliary functions so that we don't need
// to uglify KURL.h while allowing Google-URL to be evaluated.
class KURLGooglePrivate {
public:
KURLGooglePrivate();
KURLGooglePrivate(const url_parse::Parsed&, bool isValid);
explicit KURLGooglePrivate(WTF::HashTableDeletedValueType);
explicit KURLGooglePrivate(const KURLGooglePrivate&);
KURLGooglePrivate& operator=(const KURLGooglePrivate&);
// Initializes the object. This will call through the backend initializer
// below.
void init(const KURL& base, const String& relative,
const TextEncoding* queryEncoding);
// Backend initializer. The query encoding parameters are optional and can
// be 0 (this implies UTF-8). This initializer requires that the object
// has just been created and the strings are null. Do not call on an
// already-constructed object.
template <typename CHAR>
void init(const KURL& base, const CHAR* rel, int relLength,
const TextEncoding* queryEncoding);
// Does a deep copy to the given output object.
void copyTo(KURLGooglePrivate* dest) const;
// Returns the substring of the input identified by the given component.
String componentString(const url_parse::Component&) const;
// Replaces the given components, modifying the current URL. The current
// URL must be valid.
typedef url_canon::Replacements<url_parse::UTF16Char> Replacements;
void replaceComponents(const Replacements&);
// Setters for the data. Using the ASCII version when you know the
// data is ASCII will be slightly more efficient. The UTF-8 version
// will always be correct if the caller is unsure.
void setUtf8(const CString&);
void setAscii(const CString&);
// TODO(brettw) we can support an additional optimization. Make this
// buffer support both optinal Strings and UTF-8 data. This way, we can use
// the optimization from the original KURL which uses = with the original
// string when canonicalization did not change it. This allows the strings
// to share a buffer internally, and saves a malloc.
// Getters for the data.
const CString& utf8String() const { return m_utf8; }
const String& string() const;
bool m_isValid;
bool m_protocolIsInHTTPFamily;
url_parse::Parsed m_parsed; // Indexes into the UTF-8 version of the string.
KURL* innerURL() const { return m_innerURL.get(); }
void reportMemoryUsage(MemoryObjectInfo*) const;
bool isSafeToSendToAnotherThread() const;
private:
void initInnerURL();
void initProtocolIsInHTTPFamily();
CString m_utf8;
// Set to true when the caller set us using the ASCII setter. We can
// be more efficient when we know there is no UTF-8 to worry about.
// This flag is currently always correct, but should be changed to be a
// hint (see setUtf8).
bool m_utf8IsASCII;
mutable bool m_stringIsValid;
mutable String m_string;
OwnPtr<KURL> m_innerURL;
};
} // namespace WebCore
#endif
2013-04-05 Zan Dobersek <zdobersek@igalia.com>
Remove WTF_USE_GOOGLEURL-guarded code
https://bugs.webkit.org/show_bug.cgi?id=114028
Reviewed by Ryosuke Niwa.
* WebCoreSupport/AboutDataUseFeatures.in: Remove GOOGLEURL from the list.
2013-04-04 Jacky Jiang <zhajiang@rim.com>
 
[BlackBerry] Blitting wrong rect during history navigations
......
......@@ -36,7 +36,6 @@ GCC_COMPUTED_GOTO_WORKAROUND
GLES2_RENDERING
GLIB_UNICODE
GLX
GOOGLEURL
GRAMMAR_CHECKING
GRAPHICS_SURFACE
GSTREAMER
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment