https://bugs.webkit.org/show_bug.cgi?id=75049
Reviewed by Adam Barth.
No new tests; existing layout tests cover the basic functionality, and
the new functionality won't be there until Chromium adds it. This patch
merely enables that, without changing behavior.
Source/WebCore:
* fileapi/EntryBase.cpp:
(WebCore::EntryBase::toURL): Add missing escaping of URL path.
* page/SecurityOrigin.cpp:
(WebCore::extractInnerURL): Use innerURL member, if it's populated.
* platform/KURL.h:
(WebCore::KURL::innerURL): Add innerURL member.
* platform/KURLGoogle.cpp:
(WebCore::KURLGooglePrivate::KURLGooglePrivate):
(WebCore::KURLGooglePrivate::operator=):
Add copy constructor and operator=, which are now needed since
m_innerURL needs special handling.
(WebCore::KURLGooglePrivate::setUtf8):
(WebCore::KURLGooglePrivate::setAscii):
Add calls to initInnerURL.
(WebCore::KURLGooglePrivate::initInnerURL):
Add method to init/copy m_innerURL.
(WebCore::KURLGooglePrivate::copyTo):
Handle m_innerURL during copies.
(WebCore::encodeWithURLEscapeSequences):
Unescape %2F ['/'] in paths; it's much more readable, and it's safe.
* platform/KURLGooglePrivate.h:
(WebCore::KURLGooglePrivate::innerURL): Add accessor for new m_innerURL.
Source/WebKit/chromium:
* tests/KURLTest.cpp:
TEST(KURLTest, Encode): Update expectation that '/' sails through unescaped.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105930
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-25 Eric Uhrhane <ericu@chromium.org>
+
+ Add full support for filesystem URLs.
+ https://bugs.webkit.org/show_bug.cgi?id=75049
+
+ Reviewed by Adam Barth.
+
+ No new tests; existing layout tests cover the basic functionality, and
+ the new functionality won't be there until Chromium adds it. This patch
+ merely enables that, without changing behavior.
+
+ * fileapi/EntryBase.cpp:
+ (WebCore::EntryBase::toURL): Add missing escaping of URL path.
+
+ * page/SecurityOrigin.cpp:
+ (WebCore::extractInnerURL): Use innerURL member, if it's populated.
+
+ * platform/KURL.h:
+ (WebCore::KURL::innerURL): Add innerURL member.
+
+ * platform/KURLGoogle.cpp:
+ (WebCore::KURLGooglePrivate::KURLGooglePrivate):
+ (WebCore::KURLGooglePrivate::operator=):
+ Add copy constructor and operator=, which are now needed since
+ m_innerURL needs special handling.
+ (WebCore::KURLGooglePrivate::setUtf8):
+ (WebCore::KURLGooglePrivate::setAscii):
+ Add calls to initInnerURL.
+ (WebCore::KURLGooglePrivate::initInnerURL):
+ Add method to init/copy m_innerURL.
+ (WebCore::KURLGooglePrivate::copyTo):
+ Handle m_innerURL during copies.
+ (WebCore::encodeWithURLEscapeSequences):
+ Unescape %2F ['/'] in paths; it's much more readable, and it's safe.
+
+ * platform/KURLGooglePrivate.h:
+ (WebCore::KURLGooglePrivate::innerURL): Add accessor for new m_innerURL.
+
2012-01-25 Daniel Cheng <dcheng@chromium.org>
[chromium] Refactor Clipboard invalidate for DataTransferItem/DataTransferItemList into a wrapper
result.append(DOMFileSystemBase::kExternalPathPrefix);
break;
}
- result.append(m_fullPath);
+ result.append(encodeWithURLEscapeSequences(m_fullPath));
return result.toString();
}
// security origin can be parsed using this algorithm.
static KURL extractInnerURL(const KURL& url)
{
+ if (url.innerURL())
+ return *url.innerURL();
// FIXME: Update this callsite to use the innerURL member function when
// we finish implementing it.
return KURL(ParsedURLString, decodeURLEscapeSequences(url.path()));
#ifndef KURL_h
#define KURL_h
+#include "NotImplemented.h"
#include "PlatformString.h"
#include "URLString.h"
#include <wtf/HashMap.h>
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 { notImplemented(); return 0; }
+#endif
+
#ifndef NDEBUG
void print() const;
#endif
{
}
+KURLGooglePrivate::KURLGooglePrivate(const KURLGooglePrivate& o)
+ : m_isValid(o.m_isValid)
+ , m_protocolIsInHTTPFamily(o.m_protocolIsInHTTPFamily)
+ , m_parsed(o.m_parsed)
+ , m_utf8(o.m_utf8)
+ , m_utf8IsASCII(o.m_utf8IsASCII)
+ , m_stringIsValid(o.m_stringIsValid)
+ , m_string(o.m_string)
+{
+ if (o.m_innerURL.get())
+ m_innerURL = adoptPtr(new KURL(o.m_innerURL->copy()));
+}
+
+KURLGooglePrivate& KURLGooglePrivate::operator=(const KURLGooglePrivate& o)
+{
+ m_isValid = o.m_isValid;
+ m_protocolIsInHTTPFamily = o.m_protocolIsInHTTPFamily;
+ m_parsed = o.m_parsed;
+ m_utf8 = o.m_utf8;
+ m_utf8IsASCII = o.m_utf8IsASCII;
+ m_stringIsValid = o.m_stringIsValid;
+ m_string = o.m_string;
+ if (o.m_innerURL.get())
+ m_innerURL = adoptPtr(new KURL(o.m_innerURL->copy()));
+ else
+ m_innerURL.clear();
+ return *this;
+}
+
// 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.
m_utf8 = str;
m_stringIsValid = false;
initProtocolIsInHTTPFamily();
+ initInnerURL();
}
void KURLGooglePrivate::setAscii(const CString& str)
m_utf8IsASCII = true;
m_stringIsValid = false;
initProtocolIsInHTTPFamily();
+ initInnerURL();
}
void KURLGooglePrivate::init(const KURL& base,
}
}
+void KURLGooglePrivate::initInnerURL()
+{
+ if (!m_isValid) {
+ m_innerURL.clear();
+ return;
+ }
+ url_parse::Parsed* innerParsed = m_parsed.inner_parsed();
+ if (innerParsed)
+ m_innerURL = adoptPtr(new KURL(
+ ParsedURLString,
+ String(m_utf8.data() + innerParsed->scheme.begin, innerParsed->Length() - innerParsed->scheme.begin)));
+ else
+ m_innerURL.clear();
+}
+
void KURLGooglePrivate::initProtocolIsInHTTPFamily()
{
if (!m_isValid) {
dest->m_utf8IsASCII = m_utf8IsASCII;
dest->m_stringIsValid = false;
dest->m_string = String(); // Clear the invalid string to avoid cross thread ref counting.
+ if (m_innerURL)
+ dest->m_innerURL = adoptPtr(new KURL(m_innerURL->copy()));
+ else
+ dest->m_innerURL.clear();
}
String KURLGooglePrivate::componentString(const url_parse::Component& comp) const
buffer.Resize(inputLength * 3);
url_util::EncodeURIComponent(input, inputLength, &buffer);
- return String(buffer.data(), buffer.length());
+ String escaped(buffer.data(), buffer.length());
+ // Unescape '/'; it's safe and much prettier.
+ escaped.replace("%2F", "/");
+ return escaped;
}
bool KURL::isHierarchical() const
#ifndef KURLGooglePrivate_h
#define KURLGooglePrivate_h
+#include <wtf/OwnPtr.h>
#include <wtf/text/CString.h>
#include <googleurl/src/url_parse.h>
KURLGooglePrivate();
KURLGooglePrivate(const url_parse::Parsed&, bool isValid);
KURLGooglePrivate(WTF::HashTableDeletedValueType);
+ KURLGooglePrivate(const KURLGooglePrivate&);
+ KURLGooglePrivate& operator=(const KURLGooglePrivate&);
// Initializes the object. This will call through the backend initializer
// below.
bool m_protocolIsInHTTPFamily;
url_parse::Parsed m_parsed; // Indexes into the UTF-8 version of the string.
+ KURL* innerURL() const { return m_innerURL.get(); }
+
private:
+ void initInnerURL();
void initProtocolIsInHTTPFamily();
CString m_utf8;
mutable bool m_stringIsValid;
mutable String m_string;
+
+ OwnPtr<KURL> m_innerURL;
};
} // namespace WebCore
+2012-01-25 Eric Uhrhane <ericu@chromium.org>
+
+ Add full support for filesystem URLs.
+ https://bugs.webkit.org/show_bug.cgi?id=75049
+
+ Reviewed by Adam Barth.
+
+ No new tests; existing layout tests cover the basic functionality, and
+ the new functionality won't be there until Chromium adds it. This patch
+ merely enables that, without changing behavior.
+
+ * tests/KURLTest.cpp:
+ TEST(KURLTest, Encode): Update expectation that '/' sails through unescaped.
+
2012-01-25 Joshua Bell <jsbell@chromium.org>
IndexedDB: Need to distinguish key paths that don't yield value vs. yield invalid key
{"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F",
"%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F"},
{" !\"#$%&'()*+,-./",
- "%20!%22%23%24%25%26'()*%2B%2C-.%2F"},
+ "%20!%22%23%24%25%26'()*%2B%2C-./"},
{"0123456789:;<=>?",
"0123456789%3A%3B%3C%3D%3E%3F"},
{"@ABCDEFGHIJKLMNO",