diff options
author | commit-queue@webkit.org <commit-queue@webkit.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2012-06-15 02:50:55 +0000 |
---|---|---|
committer | commit-queue@webkit.org <commit-queue@webkit.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2012-06-15 02:50:55 +0000 |
commit | 17244a7a8533c96bfefdc73c71a2c0ac5cafd995 (patch) | |
tree | fb5b697ac2aedc00febdbfbe0b273a1c649fbda6 | |
parent | 34cff9677a90ddb6129dd7b0ae86e4cf2f4036af (diff) | |
download | chromium_src-17244a7a8533c96bfefdc73c71a2c0ac5cafd995.zip chromium_src-17244a7a8533c96bfefdc73c71a2c0ac5cafd995.tar.gz chromium_src-17244a7a8533c96bfefdc73c71a2c0ac5cafd995.tar.bz2 |
Unreviewed, rolling out r120384.
http://trac.webkit.org/changeset/120384
https://bugs.webkit.org/show_bug.cgi?id=89157
breaks create-blob-url-from-data-url.html (Requested by
morrita on #webkit).
Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-06-14
Source/WebCore:
* fileapi/Blob.cpp:
(WebCore::Blob::Blob):
* fileapi/BlobURL.cpp:
(WebCore::BlobURL::createBlobURL):
* fileapi/BlobURL.h:
(BlobURL):
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::start):
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore):
(WebCore::ThreadableBlobRegistry::registerBlobURL):
(WebCore::ThreadableBlobRegistry::unregisterBlobURL):
* fileapi/ThreadableBlobRegistry.h:
(WebCore):
(ThreadableBlobRegistry):
* html/DOMURL.cpp:
(WebCore::DOMURL::createObjectURL):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::create):
LayoutTests:
* fast/files/file-reader-file-url-expected.txt: Removed.
* fast/files/file-reader-file-url.html: Removed.
* fast/files/resources/file-reader-file-url-iframe.html: Removed.
git-svn-id: svn://svn.chromium.org/blink/trunk@120392 bbb929c8-8fbe-4397-9dbb-9b2b20218538
13 files changed, 52 insertions, 116 deletions
diff --git a/third_party/WebKit/LayoutTests/ChangeLog b/third_party/WebKit/LayoutTests/ChangeLog index 8a8b80c..135cc46 100644 --- a/third_party/WebKit/LayoutTests/ChangeLog +++ b/third_party/WebKit/LayoutTests/ChangeLog @@ -1,3 +1,16 @@ +2012-06-14 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r120384. + http://trac.webkit.org/changeset/120384 + https://bugs.webkit.org/show_bug.cgi?id=89157 + + breaks create-blob-url-from-data-url.html (Requested by + morrita on #webkit). + + * fast/files/file-reader-file-url-expected.txt: Removed. + * fast/files/file-reader-file-url.html: Removed. + * fast/files/resources/file-reader-file-url-iframe.html: Removed. + 2012-06-14 Dale Curtis <dalecurtis@chromium.org> Disable click/dbl-click on MediaDocument for Chromium. Fix layout test for all platforms. diff --git a/third_party/WebKit/LayoutTests/fast/files/file-reader-file-url-expected.txt b/third_party/WebKit/LayoutTests/fast/files/file-reader-file-url-expected.txt deleted file mode 100644 index 516fb3c..0000000 --- a/third_party/WebKit/LayoutTests/fast/files/file-reader-file-url-expected.txt +++ /dev/null @@ -1,3 +0,0 @@ -CONSOLE MESSAGE: line 9: Received data: 0123456789 - -Test that FileReader works under the file URL with file path separation enforced. diff --git a/third_party/WebKit/LayoutTests/fast/files/file-reader-file-url.html b/third_party/WebKit/LayoutTests/fast/files/file-reader-file-url.html deleted file mode 100644 index 666058c..0000000 --- a/third_party/WebKit/LayoutTests/fast/files/file-reader-file-url.html +++ /dev/null @@ -1,17 +0,0 @@ -<html> -<head> -<script> -if (window.layoutTestController) { - layoutTestController.setAllowUniversalAccessFromFileURLs(false); - layoutTestController.setAllowFileAccessFromFileURLs(false); - layoutTestController.dumpAsText(); - layoutTestController.waitUntilDone(); -} -</script> -</head> -<body> -<iframe src="resources/file-reader-file-url-iframe.html"></iframe> -<div id="results"></div> -Test that FileReader works under the file URL with file path separation enforced. -</body> -</html> diff --git a/third_party/WebKit/LayoutTests/fast/files/resources/file-reader-file-url-iframe.html b/third_party/WebKit/LayoutTests/fast/files/resources/file-reader-file-url-iframe.html deleted file mode 100644 index 51fcc69..0000000 --- a/third_party/WebKit/LayoutTests/fast/files/resources/file-reader-file-url-iframe.html +++ /dev/null @@ -1,25 +0,0 @@ -<html> -<head> -<script> -function runTest() -{ - var blob = new Blob(["0123456789"]); - var reader = new FileReader(); - reader.onload = function(event) { - console.log("Received data: " + event.target.result); - } - reader.onloadend = function() { - if (window.layoutTestController) - layoutTestController.notifyDone(); - } - reader.onerror = function(event) { - console.log("Received error event: " + event.target.error.code); - }; - reader.readAsText(blob); -} - -</script> -</head> -<body onload="runTest()"> -</body> -</html> diff --git a/third_party/WebKit/Source/WebCore/ChangeLog b/third_party/WebKit/Source/WebCore/ChangeLog index d3e6e2b..0142b91 100644 --- a/third_party/WebKit/Source/WebCore/ChangeLog +++ b/third_party/WebKit/Source/WebCore/ChangeLog @@ -1,3 +1,32 @@ +2012-06-14 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r120384. + http://trac.webkit.org/changeset/120384 + https://bugs.webkit.org/show_bug.cgi?id=89157 + + breaks create-blob-url-from-data-url.html (Requested by + morrita on #webkit). + + * fileapi/Blob.cpp: + (WebCore::Blob::Blob): + * fileapi/BlobURL.cpp: + (WebCore::BlobURL::createBlobURL): + * fileapi/BlobURL.h: + (BlobURL): + * fileapi/FileReaderLoader.cpp: + (WebCore::FileReaderLoader::start): + * fileapi/ThreadableBlobRegistry.cpp: + (WebCore): + (WebCore::ThreadableBlobRegistry::registerBlobURL): + (WebCore::ThreadableBlobRegistry::unregisterBlobURL): + * fileapi/ThreadableBlobRegistry.h: + (WebCore): + (ThreadableBlobRegistry): + * html/DOMURL.cpp: + (WebCore::DOMURL::createObjectURL): + * page/SecurityOrigin.cpp: + (WebCore::SecurityOrigin::create): + 2012-06-14 Yoshifumi Inoue <yosin@chromium.org> [Forms] Copy RenderTextControlSingleLine.{cpp,h} to RenderSearchFiled.{cpp,h} diff --git a/third_party/WebKit/Source/WebCore/fileapi/Blob.cpp b/third_party/WebKit/Source/WebCore/fileapi/Blob.cpp index d1dcb51..5c27e3b 100644 --- a/third_party/WebKit/Source/WebCore/fileapi/Blob.cpp +++ b/third_party/WebKit/Source/WebCore/fileapi/Blob.cpp @@ -77,7 +77,7 @@ Blob::Blob(const KURL& srcURL, const String& type, long long size) { // Create a new internal URL and register it with the same blob data as the source URL. m_internalURL = BlobURL::createInternalURL(); - ThreadableBlobRegistry::registerBlobURL(0, m_internalURL, srcURL); + ThreadableBlobRegistry::registerBlobURL(m_internalURL, srcURL); } Blob::~Blob() diff --git a/third_party/WebKit/Source/WebCore/fileapi/BlobURL.cpp b/third_party/WebKit/Source/WebCore/fileapi/BlobURL.cpp index f747853..5d79141 100644 --- a/third_party/WebKit/Source/WebCore/fileapi/BlobURL.cpp +++ b/third_party/WebKit/Source/WebCore/fileapi/BlobURL.cpp @@ -52,15 +52,6 @@ KURL BlobURL::createInternalURL() return createBlobURL("blobinternal://"); } -String BlobURL::getOrigin(const KURL& url) -{ - ASSERT(url.protocolIs(kBlobProtocol)); - - unsigned startIndex = url.pathStart(); - unsigned endIndex = url.pathAfterLastSlash(); - return url.string().substring(startIndex, endIndex - startIndex - 1); -} - String BlobURL::getIdentifier(const KURL& url) { ASSERT(url.protocolIs(kBlobProtocol)); @@ -72,6 +63,8 @@ String BlobURL::getIdentifier(const KURL& url) KURL BlobURL::createBlobURL(const String& originString) { ASSERT(!originString.isEmpty()); + if (originString == "null") + return KURL(); String urlString = kBlobProtocol; urlString += ":"; urlString += encodeWithURLEscapeSequences(originString); diff --git a/third_party/WebKit/Source/WebCore/fileapi/BlobURL.h b/third_party/WebKit/Source/WebCore/fileapi/BlobURL.h index 2caec29..4ea59fe 100644 --- a/third_party/WebKit/Source/WebCore/fileapi/BlobURL.h +++ b/third_party/WebKit/Source/WebCore/fileapi/BlobURL.h @@ -50,7 +50,6 @@ class BlobURL { public: static KURL createPublicURL(SecurityOrigin*); static KURL createInternalURL(); - static String getOrigin(const KURL&); static String getIdentifier(const KURL&); static const char* blobProtocol() { return kBlobProtocol; } diff --git a/third_party/WebKit/Source/WebCore/fileapi/FileReaderLoader.cpp b/third_party/WebKit/Source/WebCore/fileapi/FileReaderLoader.cpp index eec8ff6..e55149a 100644 --- a/third_party/WebKit/Source/WebCore/fileapi/FileReaderLoader.cpp +++ b/third_party/WebKit/Source/WebCore/fileapi/FileReaderLoader.cpp @@ -80,7 +80,7 @@ void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, Blo failed(FileError::SECURITY_ERR); return; } - ThreadableBlobRegistry::registerBlobURL(scriptExecutionContext->securityOrigin(), m_urlForReading, blob->url()); + ThreadableBlobRegistry::registerBlobURL(m_urlForReading, blob->url()); // Construct and load the request. ResourceRequest request(m_urlForReading); diff --git a/third_party/WebKit/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp b/third_party/WebKit/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp index a55db6d..2ec421b 100644 --- a/third_party/WebKit/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp +++ b/third_party/WebKit/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp @@ -34,15 +34,7 @@ #include "BlobData.h" #include "BlobRegistry.h" -#include "BlobURL.h" -#include "SecurityOrigin.h" -#include <wtf/HashMap.h> #include <wtf/MainThread.h> -#include <wtf/RefPtr.h> -#include <wtf/ThreadSpecific.h> -#include <wtf/text/StringHash.h> - -using WTF::ThreadSpecific; namespace WebCore { @@ -72,13 +64,6 @@ struct BlobRegistryContext { #if ENABLE(BLOB) -typedef HashMap<String, RefPtr<SecurityOrigin> > BlobUrlOriginMap; -static ThreadSpecific<BlobUrlOriginMap>& originMap() -{ - AtomicallyInitializedStatic(ThreadSpecific<BlobUrlOriginMap>*, map = new ThreadSpecific<BlobUrlOriginMap>); - return *map; -} - static void registerBlobURLTask(void* context) { OwnPtr<BlobRegistryContext> blobRegistryContext = adoptPtr(static_cast<BlobRegistryContext*>(context)); @@ -101,12 +86,8 @@ static void registerBlobURLFromTask(void* context) blobRegistry().registerBlobURL(blobRegistryContext->url, blobRegistryContext->srcURL); } -void ThreadableBlobRegistry::registerBlobURL(SecurityOrigin* origin, const KURL& url, const KURL& srcURL) +void ThreadableBlobRegistry::registerBlobURL(const KURL& url, const KURL& srcURL) { - // If the blob URL contains null origin, as in the context with unique security origin or file URL, save the mapping between url and origin so that the origin can be retrived when doing security origin check. - if (origin && BlobURL::getOrigin(url) == "null") - originMap()->add(url.string(), origin); - if (isMainThread()) blobRegistry().registerBlobURL(url, srcURL); else { @@ -123,41 +104,27 @@ static void unregisterBlobURLTask(void* context) void ThreadableBlobRegistry::unregisterBlobURL(const KURL& url) { - if (BlobURL::getOrigin(url) == "null") - originMap()->remove(url.string()); - - if (isMainThread()) { + if (isMainThread()) blobRegistry().unregisterBlobURL(url); - } else { + else { OwnPtr<BlobRegistryContext> context = adoptPtr(new BlobRegistryContext(url)); callOnMainThread(&unregisterBlobURLTask, context.leakPtr()); } } -PassRefPtr<SecurityOrigin> ThreadableBlobRegistry::cachedOrigin(const KURL& url) -{ - return originMap()->get(url.string()); -} - #else void ThreadableBlobRegistry::registerBlobURL(const KURL&, PassOwnPtr<BlobData>) { } -void ThreadableBlobRegistry::registerBlobURL(SecurityOrigin*, const KURL&, const KURL&) +void ThreadableBlobRegistry::registerBlobURL(const KURL&, const KURL&) { } void ThreadableBlobRegistry::unregisterBlobURL(const KURL&) { } - -PassRefPtr<SecurityOrigin> ThreadableBlobRegistry::cachedOrigin(const KURL& url) -{ - return 0; -} - #endif // ENABL(BLOB) } // namespace WebCore diff --git a/third_party/WebKit/Source/WebCore/fileapi/ThreadableBlobRegistry.h b/third_party/WebKit/Source/WebCore/fileapi/ThreadableBlobRegistry.h index a9ca98d2..fe7df7f 100644 --- a/third_party/WebKit/Source/WebCore/fileapi/ThreadableBlobRegistry.h +++ b/third_party/WebKit/Source/WebCore/fileapi/ThreadableBlobRegistry.h @@ -32,23 +32,17 @@ #define ThreadableBlobRegistry_h #include <wtf/PassOwnPtr.h> -#include <wtf/PassRefPtr.h> namespace WebCore { class BlobData; class KURL; -class SecurityOrigin; class ThreadableBlobRegistry { public: static void registerBlobURL(const KURL&, PassOwnPtr<BlobData>); - static void registerBlobURL(SecurityOrigin*, const KURL&, const KURL& srcURL); + static void registerBlobURL(const KURL&, const KURL& srcURL); static void unregisterBlobURL(const KURL&); - - // Returns the origin for the given blob URL. This is because we are not able to embed the unique security origin or the origin of file URL - // in the blob URL. - static PassRefPtr<SecurityOrigin> cachedOrigin(const KURL&); }; } // namespace WebCore diff --git a/third_party/WebKit/Source/WebCore/html/DOMURL.cpp b/third_party/WebKit/Source/WebCore/html/DOMURL.cpp index 4f9780d..37c6520 100644 --- a/third_party/WebKit/Source/WebCore/html/DOMURL.cpp +++ b/third_party/WebKit/Source/WebCore/html/DOMURL.cpp @@ -78,7 +78,7 @@ String DOMURL::createObjectURL(ScriptExecutionContext* scriptExecutionContext, B if (publicURL.isEmpty()) return String(); - ThreadableBlobRegistry::registerBlobURL(scriptExecutionContext->securityOrigin(), publicURL, blob->url()); + ThreadableBlobRegistry::registerBlobURL(publicURL, blob->url()); scriptExecutionContext->publicURLManager().blobURLs().add(publicURL.string()); return publicURL.string(); diff --git a/third_party/WebKit/Source/WebCore/page/SecurityOrigin.cpp b/third_party/WebKit/Source/WebCore/page/SecurityOrigin.cpp index 7a80661..25bae02 100644 --- a/third_party/WebKit/Source/WebCore/page/SecurityOrigin.cpp +++ b/third_party/WebKit/Source/WebCore/page/SecurityOrigin.cpp @@ -35,7 +35,6 @@ #include "KURL.h" #include "SchemeRegistry.h" #include "SecurityPolicy.h" -#include "ThreadableBlobRegistry.h" #include <wtf/MainThread.h> #include <wtf/StdLibExtras.h> #include <wtf/text/StringBuilder.h> @@ -90,15 +89,6 @@ static KURL extractInnerURL(const KURL& url) return KURL(ParsedURLString, decodeURLEscapeSequences(url.path())); } -static PassRefPtr<SecurityOrigin> getCachedOrigin(const KURL& url) -{ -#if ENABLE(BLOB) - if (url.protocolIs("blob")) - return ThreadableBlobRegistry::cachedOrigin(url); -#endif - return 0; -} - static bool shouldTreatAsUniqueOrigin(const KURL& url) { if (!url.isValid()) @@ -181,10 +171,6 @@ SecurityOrigin::SecurityOrigin(const SecurityOrigin* other) PassRefPtr<SecurityOrigin> SecurityOrigin::create(const KURL& url) { - RefPtr<SecurityOrigin> cachedOrigin = getCachedOrigin(url); - if (cachedOrigin.get()) - return cachedOrigin; - if (shouldTreatAsUniqueOrigin(url)) { RefPtr<SecurityOrigin> origin = adoptRef(new SecurityOrigin()); |