diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-18 18:46:40 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-18 18:46:40 +0000 |
commit | 43390223664bd9e55d33b56799e3d98d5504be6b (patch) | |
tree | 247531d999c44f8ba121eafa07be607bace01a02 /webkit/glue | |
parent | 7e1e1d207ef6e11fb5790b95c737c9b1f4ffdada (diff) | |
download | chromium_src-43390223664bd9e55d33b56799e3d98d5504be6b.zip chromium_src-43390223664bd9e55d33b56799e3d98d5504be6b.tar.gz chromium_src-43390223664bd9e55d33b56799e3d98d5504be6b.tar.bz2 |
Chrome side of unforking. I need to pull WebKit with the change that unforks KURL.h
This makes us defile USE(GOOGLEURL) and use that instead of USE_GOOGLE_URL_LIBRARY.
I also fixed some places to be able to compile without it if possible (I think
I will be wanting that capability in the future to test changes they may make
upstream).
Review URL: http://codereview.chromium.org/14494
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7231 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/chromium_bridge_impl.cc | 24 | ||||
-rw-r--r-- | webkit/glue/glue_util.cc | 4 |
2 files changed, 24 insertions, 4 deletions
diff --git a/webkit/glue/chromium_bridge_impl.cc b/webkit/glue/chromium_bridge_impl.cc index 7422c0c..617ea08 100644 --- a/webkit/glue/chromium_bridge_impl.cc +++ b/webkit/glue/chromium_bridge_impl.cc @@ -156,7 +156,11 @@ void ChromiumBridge::clipboardWriteSelection(const String& html, bool can_smart_copy_or_delete) { ScopedClipboardWriterGlue scw(webkit_glue::ClipboardGetClipboard()); scw.WriteHTML(webkit_glue::StringToStdWString(html), +#if USE(GOOGLEURL) webkit_glue::CStringToStdString(url.utf8String())); +#else + webkit_glue::StringToStdString(url.string())); +#endif scw.WriteText(webkit_glue::StringToStdWString(plain_text)); if (can_smart_copy_or_delete) @@ -543,13 +547,29 @@ WebCore::LinkHash ChromiumBridge::visitedLinkHash( url_canon::RawCanonOutput<2048> buffer; url_parse::Parsed parsed; +#if USE(GOOGLEURL) const WebCore::CString& cstr = base.utf8String(); - if (!url_util::ResolveRelative(cstr.data(), cstr.length(), base.parsed(), + const char* data = cstr.data(); + int length = cstr.length(); + const url_parse::Parsed& src_parsed = base.parsed(); +#else + // When we're not using GoogleURL, first canonicalize it so we can resolve it + // below. + url_canon::RawCanonOutput<2048> src_canon; + url_parse::Parsed src_parsed; + WebCore::String str = base.string(); + if (!url_util::Canonicalize(str.characters(), str.length(), NULL, + &src_canon, &src_parsed)) + return false; + const char* data = src_canon.data(); + int length = src_canon.length(); +#endif + + if (!url_util::ResolveRelative(data, length, src_parsed, attributeURL.characters(), attributeURL.length(), NULL, &buffer, &parsed)) return false; // Invalid resolved URL. - return webkit_glue::VisitedLinkHash(buffer.data(), buffer.length()); } diff --git a/webkit/glue/glue_util.cc b/webkit/glue/glue_util.cc index 5bbae41..997af01 100644 --- a/webkit/glue/glue_util.cc +++ b/webkit/glue/glue_util.cc @@ -73,7 +73,7 @@ WebCore::String StdStringToString(const std::string& str) { // URL conversions ------------------------------------------------------------- GURL KURLToGURL(const WebCore::KURL& url) { -#ifdef USE_GOOGLE_URL_LIBRARY +#if USE(GOOGLEURL) const WebCore::CString& spec = url.utf8String(); if (spec.isNull() || 0 == spec.length()) return GURL(); @@ -85,7 +85,7 @@ GURL KURLToGURL(const WebCore::KURL& url) { WebCore::KURL GURLToKURL(const GURL& url) { const std::string& spec = url.possibly_invalid_spec(); -#ifdef USE_GOOGLE_URL_LIBRARY +#if USE(GOOGLEURL) // Convert using the internal structures to avoid re-parsing. return WebCore::KURL(spec.c_str(), static_cast<int>(spec.length()), url.parsed_for_possibly_invalid_spec(), url.is_valid()); |