<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[196174] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/196174">196174</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2016-02-05 08:57:08 -0800 (Fri, 05 Feb 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Clean up Blob code
https://bugs.webkit.org/show_bug.cgi?id=153910
Reviewed by Alexey Proskuryakov.
Source/WebCore:
No new tests, no change in behavior.
* css/StyleSheet.h:
* fileapi/Blob.cpp:
(WebCore::Blob::Blob):
(WebCore::Blob::normalizedContentType):
(WebCore::Blob::isNormalizedContentType):
(WebCore::Blob::registry):
* fileapi/Blob.h:
* fileapi/BlobURL.cpp:
(WebCore::BlobURL::createPublicURL):
* fileapi/BlobURL.h:
(WebCore::BlobURL::BlobURL):
(WebCore::BlobURL::blobProtocol): Deleted.
* platform/PlatformStrategies.cpp:
(WebCore::setPlatformStrategies):
(WebCore::hasPlatformStrategies): Deleted.
* platform/PlatformStrategies.h:
* platform/network/BlobRegistry.cpp:
(WebCore::blobRegistry):
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::~BlobRegistryImpl):
(WebCore::createResourceHandle):
(WebCore::registerBlobResourceHandleConstructor):
(WebCore::BlobRegistryImpl::createResourceHandle):
(WebCore::BlobRegistryImpl::appendStorageItems):
(WebCore::BlobRegistryImpl::registerFileBlobURL):
(WebCore::BlobRegistryImpl::registerBlobURL):
* platform/network/BlobRegistryImpl.h:
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::loadResourceSynchronously):
(WebCore::BlobResourceHandle::BlobResourceHandle):
* platform/network/ResourceHandle.h:
Source/WebKit2:
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::NetworkBlobRegistry):
(WebKit::NetworkBlobRegistry::registerFileBlobURL):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerFileBlobURL):
* WebProcess/FileAPI/BlobRegistryProxy.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssStyleSheeth">trunk/Source/WebCore/css/StyleSheet.h</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobcpp">trunk/Source/WebCore/fileapi/Blob.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobh">trunk/Source/WebCore/fileapi/Blob.h</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobURLcpp">trunk/Source/WebCore/fileapi/BlobURL.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobURLh">trunk/Source/WebCore/fileapi/BlobURL.h</a></li>
<li><a href="#trunkSourceWebCoreplatformPlatformStrategiescpp">trunk/Source/WebCore/platform/PlatformStrategies.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformPlatformStrategiesh">trunk/Source/WebCore/platform/PlatformStrategies.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistrycpp">trunk/Source/WebCore/platform/network/BlobRegistry.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryh">trunk/Source/WebCore/platform/network/BlobRegistry.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryImplcpp">trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryImplh">trunk/Source/WebCore/platform/network/BlobRegistryImpl.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobResourceHandlecpp">trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandleh">trunk/Source/WebCore/platform/network/ResourceHandle.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistrycpp">trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistryh">trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcesscpp">trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessFileAPIBlobRegistryProxycpp">trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessFileAPIBlobRegistryProxyh">trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebCore/ChangeLog        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2016-02-05 Alex Christensen <achristensen@webkit.org>
+
+ Clean up Blob code
+ https://bugs.webkit.org/show_bug.cgi?id=153910
+
+ Reviewed by Alexey Proskuryakov.
+
+ No new tests, no change in behavior.
+
+ * css/StyleSheet.h:
+ * fileapi/Blob.cpp:
+ (WebCore::Blob::Blob):
+ (WebCore::Blob::normalizedContentType):
+ (WebCore::Blob::isNormalizedContentType):
+ (WebCore::Blob::registry):
+ * fileapi/Blob.h:
+ * fileapi/BlobURL.cpp:
+ (WebCore::BlobURL::createPublicURL):
+ * fileapi/BlobURL.h:
+ (WebCore::BlobURL::BlobURL):
+ (WebCore::BlobURL::blobProtocol): Deleted.
+ * platform/PlatformStrategies.cpp:
+ (WebCore::setPlatformStrategies):
+ (WebCore::hasPlatformStrategies): Deleted.
+ * platform/PlatformStrategies.h:
+ * platform/network/BlobRegistry.cpp:
+ (WebCore::blobRegistry):
+ * platform/network/BlobRegistry.h:
+ * platform/network/BlobRegistryImpl.cpp:
+ (WebCore::BlobRegistryImpl::~BlobRegistryImpl):
+ (WebCore::createResourceHandle):
+ (WebCore::registerBlobResourceHandleConstructor):
+ (WebCore::BlobRegistryImpl::createResourceHandle):
+ (WebCore::BlobRegistryImpl::appendStorageItems):
+ (WebCore::BlobRegistryImpl::registerFileBlobURL):
+ (WebCore::BlobRegistryImpl::registerBlobURL):
+ * platform/network/BlobRegistryImpl.h:
+ * platform/network/BlobResourceHandle.cpp:
+ (WebCore::BlobResourceHandle::loadResourceSynchronously):
+ (WebCore::BlobResourceHandle::BlobResourceHandle):
+ * platform/network/ResourceHandle.h:
+
</ins><span class="cx"> 2016-02-05 Carlos Garcia Campos <cgarcia@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Scrollbars incorrectly rendered with older versions of GTK+
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleSheeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleSheet.h (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleSheet.h        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebCore/css/StyleSheet.h        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -22,7 +22,6 @@
</span><span class="cx"> #define StyleSheet_h
</span><span class="cx">
</span><span class="cx"> #include "CSSParserMode.h"
</span><del>-#include "URLHash.h"
</del><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/ListHashSet.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/Blob.cpp (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/Blob.cpp        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebCore/fileapi/Blob.cpp        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx"> , m_size(size)
</span><span class="cx"> {
</span><span class="cx"> m_internalURL = BlobURL::createInternalURL();
</span><del>- ThreadableBlobRegistry::registerBlobURL(0, m_internalURL, srcURL);
</del><ins>+ ThreadableBlobRegistry::registerBlobURL(nullptr, m_internalURL, srcURL);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Blob::Blob(const URL& srcURL, long long start, long long end, const String& type)
</span><span class="lines">@@ -146,6 +146,7 @@
</span><span class="cx"> return contentType.convertToASCIILowercase();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if !ASSERT_DISABLED
</ins><span class="cx"> bool Blob::isNormalizedContentType(const String& contentType)
</span><span class="cx"> {
</span><span class="cx"> // FIXME: Do we really want to treat the empty string and null string as valid content types?
</span><span class="lines">@@ -172,6 +173,7 @@
</span><span class="cx"> }
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx">
</span><span class="cx"> URLRegistry& Blob::registry() const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/Blob.h (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/Blob.h        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebCore/fileapi/Blob.h        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -76,9 +76,10 @@
</span><span class="cx"> static bool isValidContentType(const String&);
</span><span class="cx"> // The normalization procedure described in the File API spec.
</span><span class="cx"> static String normalizedContentType(const String&);
</span><del>- // Intended for use in ASSERT statements.
</del><ins>+#if !ASSERT_DISABLED
</ins><span class="cx"> static bool isNormalizedContentType(const String&);
</span><span class="cx"> static bool isNormalizedContentType(const CString&);
</span><ins>+#endif
</ins><span class="cx">
</span><span class="cx"> // URLRegistrable
</span><span class="cx"> virtual URLRegistry& registry() const override;
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobURLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/BlobURL.cpp (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/BlobURL.cpp        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebCore/fileapi/BlobURL.cpp        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-const char BlobURL::kBlobProtocol[] = "blob";
</del><ins>+const char* kBlobProtocol = "blob";
</ins><span class="cx">
</span><span class="cx"> URL BlobURL::createPublicURL(SecurityOrigin* securityOrigin)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobURLh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/BlobURL.h (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/BlobURL.h        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebCore/fileapi/BlobURL.h        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -52,11 +52,9 @@
</span><span class="cx"> static URL createInternalURL();
</span><span class="cx"> static String getOrigin(const URL&);
</span><span class="cx"> static String getIdentifier(const URL&);
</span><del>- static const char* blobProtocol() { return kBlobProtocol; }
</del><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> static URL createBlobURL(const String& originString);
</span><del>- static const char kBlobProtocol[];
</del><span class="cx"> BlobURL() { }
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformPlatformStrategiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/PlatformStrategies.cpp (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/PlatformStrategies.cpp        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebCore/platform/PlatformStrategies.cpp        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -49,10 +49,5 @@
</span><span class="cx"> ASSERT(platformStrategies == s_platformStrategies);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool hasPlatformStrategies()
-{
- return s_platformStrategies;
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformPlatformStrategiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/PlatformStrategies.h (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/PlatformStrategies.h        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebCore/platform/PlatformStrategies.h        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -96,7 +96,6 @@
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT PlatformStrategies* platformStrategies();
</span><span class="cx"> WEBCORE_EXPORT void setPlatformStrategies(PlatformStrategies*);
</span><del>-bool hasPlatformStrategies();
</del><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistry.cpp (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistry.cpp        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebCore/platform/network/BlobRegistry.cpp        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -26,15 +26,9 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "BlobRegistry.h"
</span><span class="cx">
</span><del>-#include "BlobRegistryImpl.h"
-#include "LoaderStrategy.h"
</del><span class="cx"> #include "PlatformStrategies.h"
</span><span class="cx"> #include <wtf/MainThread.h>
</span><span class="cx">
</span><del>-#if PLATFORM(IOS)
-#include "WebCoreThread.h"
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> BlobRegistry& blobRegistry()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistry.h (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistry.h        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebCore/platform/network/BlobRegistry.h        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> public:
</span><span class="cx">
</span><span class="cx"> // Registers a blob URL referring to the specified file.
</span><del>- virtual void registerFileBlobURL(const URL&, PassRefPtr<BlobDataFileReference>, const String& contentType) = 0;
</del><ins>+ virtual void registerFileBlobURL(const URL&, RefPtr<BlobDataFileReference>&&, const String& contentType) = 0;
</ins><span class="cx">
</span><span class="cx"> // Registers a blob URL referring to the specified blob data.
</span><span class="cx"> virtual void registerBlobURL(const URL&, Vector<BlobPart>, const String& contentType) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -44,17 +44,13 @@
</span><span class="cx"> #include <wtf/MainThread.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="cx">
</span><del>-#if PLATFORM(IOS)
-#include "WebCoreThread.h"
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> BlobRegistryImpl::~BlobRegistryImpl()
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static PassRefPtr<ResourceHandle> createResourceHandle(const ResourceRequest& request, ResourceHandleClient* client)
</del><ins>+static RefPtr<ResourceHandle> createResourceHandle(const ResourceRequest& request, ResourceHandleClient* client)
</ins><span class="cx"> {
</span><span class="cx"> return static_cast<BlobRegistryImpl&>(blobRegistry()).createResourceHandle(request, client);
</span><span class="cx"> }
</span><span class="lines">@@ -75,14 +71,14 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<ResourceHandle> BlobRegistryImpl::createResourceHandle(const ResourceRequest& request, ResourceHandleClient* client)
</del><ins>+RefPtr<ResourceHandle> BlobRegistryImpl::createResourceHandle(const ResourceRequest& request, ResourceHandleClient* client)
</ins><span class="cx"> {
</span><del>- RefPtr<BlobResourceHandle> handle = BlobResourceHandle::createAsync(getBlobDataFromURL(request.url()), request, client);
</del><ins>+ auto handle = BlobResourceHandle::createAsync(getBlobDataFromURL(request.url()), request, client);
</ins><span class="cx"> if (!handle)
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx">
</span><span class="cx"> handle->start();
</span><del>- return handle.release();
</del><ins>+ return handle;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void BlobRegistryImpl::appendStorageItems(BlobData* blobData, const BlobDataItemList& items, long long offset, long long length)
</span><span class="lines">@@ -114,7 +110,7 @@
</span><span class="cx"> ASSERT(!length);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void BlobRegistryImpl::registerFileBlobURL(const URL& url, PassRefPtr<BlobDataFileReference> file, const String& contentType)
</del><ins>+void BlobRegistryImpl::registerFileBlobURL(const URL& url, RefPtr<BlobDataFileReference>&& file, const String& contentType)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx"> registerBlobResourceHandleConstructor();
</span><span class="lines">@@ -148,10 +144,10 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case BlobPart::Blob: {
</span><del>- if (!m_blobs.contains(part.url().string()))
- return;
- for (const BlobDataItem& item : m_blobs.get(part.url().string())->items())
- blobData->m_items.append(item);
</del><ins>+ if (auto blob = m_blobs.get(part.url().string())) {
+ for (const BlobDataItem& item : blob->items())
+ blobData->m_items.append(item);
+ }
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.h (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.h        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.h        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx">
</span><span class="cx"> #include "BlobData.h"
</span><span class="cx"> #include "BlobRegistry.h"
</span><ins>+#include "URLHash.h"
</ins><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx"> #include <wtf/text/StringHash.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="lines">@@ -52,12 +53,12 @@
</span><span class="cx">
</span><span class="cx"> BlobData* getBlobDataFromURL(const URL&) const;
</span><span class="cx">
</span><del>- PassRefPtr<ResourceHandle> createResourceHandle(const ResourceRequest&, ResourceHandleClient*);
</del><ins>+ RefPtr<ResourceHandle> createResourceHandle(const ResourceRequest&, ResourceHandleClient*);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> void appendStorageItems(BlobData*, const BlobDataItemList&, long long offset, long long length);
</span><span class="cx">
</span><del>- virtual void registerFileBlobURL(const WebCore::URL&, PassRefPtr<BlobDataFileReference>, const String& contentType) override;
</del><ins>+ virtual void registerFileBlobURL(const URL&, RefPtr<BlobDataFileReference>&&, const String& contentType) override;
</ins><span class="cx"> virtual void registerBlobURL(const URL&, Vector<BlobPart>, const String& contentType) override;
</span><span class="cx"> virtual void registerBlobURL(const URL&, const URL& srcURL) override;
</span><span class="cx"> virtual void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobResourceHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -156,7 +156,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> BlobResourceHandle::BlobResourceHandle(BlobData* blobData, const ResourceRequest& request, ResourceHandleClient* client, bool async)
</span><del>- : ResourceHandle(0, request, client, false, false)
</del><ins>+ : ResourceHandle(nullptr, request, client, false, false)
</ins><span class="cx"> , m_blobData(blobData)
</span><span class="cx"> , m_async(async)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandle.h (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandle.h        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebCore/platform/network/ResourceHandle.h        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx"> static CFMutableDictionaryRef createSSLPropertiesFromNSURLRequest(const ResourceRequest&);
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- typedef PassRefPtr<ResourceHandle> (*BuiltinConstructor)(const ResourceRequest& request, ResourceHandleClient* client);
</del><ins>+ typedef RefPtr<ResourceHandle> (*BuiltinConstructor)(const ResourceRequest& request, ResourceHandleClient* client);
</ins><span class="cx"> static void registerBuiltinConstructor(const AtomicString& protocol, BuiltinConstructor);
</span><span class="cx">
</span><span class="cx"> typedef void (*BuiltinSynchronousLoader)(NetworkingContext*, const ResourceRequest&, StoredCredentials, ResourceError&, ResourceResponse&, Vector<char>& data);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebKit2/ChangeLog        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2016-02-05 Alex Christensen <achristensen@webkit.org>
+
+ Clean up Blob code
+ https://bugs.webkit.org/show_bug.cgi?id=153910
+
+ Reviewed by Alexey Proskuryakov.
+
+ * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
+ (WebKit::NetworkBlobRegistry::NetworkBlobRegistry):
+ (WebKit::NetworkBlobRegistry::registerFileBlobURL):
+ * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
+ * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+ (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
+ (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
+ * WebProcess/FileAPI/BlobRegistryProxy.cpp:
+ (WebKit::BlobRegistryProxy::registerFileBlobURL):
+ * WebProcess/FileAPI/BlobRegistryProxy.h:
+
</ins><span class="cx"> 2016-02-05 Dan Bernstein <mitz@apple.com>
</span><span class="cx">
</span><span class="cx"> [Cocoa] Get rid of unused SPI declarations
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NetworkBlobRegistry::registerFileBlobURL(NetworkConnectionToWebProcess* connection, const URL& url, const String& path, PassRefPtr<SandboxExtension> sandboxExtension, const String& contentType)
</del><ins>+void NetworkBlobRegistry::registerFileBlobURL(NetworkConnectionToWebProcess* connection, const URL& url, const String& path, RefPtr<SandboxExtension>&& sandboxExtension, const String& contentType)
</ins><span class="cx"> {
</span><span class="cx"> blobRegistry().registerFileBlobURL(url, BlobDataFileReferenceWithSandboxExtension::create(path, sandboxExtension), contentType);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> NetworkBlobRegistry();
</span><span class="cx"> static NetworkBlobRegistry& singleton();
</span><span class="cx">
</span><del>- void registerFileBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const String& path, PassRefPtr<SandboxExtension>, const String& contentType);
</del><ins>+ void registerFileBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const String& path, RefPtr<SandboxExtension>&&, const String& contentType);
</ins><span class="cx"> void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType);
</span><span class="cx"> void registerBlobURL(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL);
</span><span class="cx"> void registerBlobURLForSlice(NetworkConnectionToWebProcess*, const WebCore::URL&, const WebCore::URL& srcURL, int64_t start, int64_t end);
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -242,7 +242,7 @@
</span><span class="cx"> {
</span><span class="cx"> RefPtr<SandboxExtension> extension = SandboxExtension::create(extensionHandle);
</span><span class="cx">
</span><del>- NetworkBlobRegistry::singleton().registerFileBlobURL(this, url, path, extension.release(), contentType);
</del><ins>+ NetworkBlobRegistry::singleton().registerFileBlobURL(this, url, path, WTFMove(extension), contentType);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void NetworkConnectionToWebProcess::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessFileAPIBlobRegistryProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><del>-void BlobRegistryProxy::registerFileBlobURL(const WebCore::URL& url, PassRefPtr<BlobDataFileReference> file, const String& contentType)
</del><ins>+void BlobRegistryProxy::registerFileBlobURL(const WebCore::URL& url, RefPtr<BlobDataFileReference>&& file, const String& contentType)
</ins><span class="cx"> {
</span><span class="cx"> SandboxExtension::Handle extensionHandle;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessFileAPIBlobRegistryProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h (196173 => 196174)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h        2016-02-05 15:38:00 UTC (rev 196173)
+++ trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h        2016-02-05 16:57:08 UTC (rev 196174)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">
</span><span class="cx"> class BlobRegistryProxy final : public WebCore::BlobRegistry {
</span><span class="cx"> public:
</span><del>- virtual void registerFileBlobURL(const WebCore::URL&, PassRefPtr<WebCore::BlobDataFileReference>, const String& contentType) override;
</del><ins>+ virtual void registerFileBlobURL(const WebCore::URL&, RefPtr<WebCore::BlobDataFileReference>&&, const String& contentType) override;
</ins><span class="cx"> virtual void registerBlobURL(const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType) override;
</span><span class="cx"> virtual void registerBlobURL(const WebCore::URL&, const WebCore::URL& srcURL) override;
</span><span class="cx"> virtual void unregisterBlobURL(const WebCore::URL&) override;
</span></span></pre>
</div>
</div>
</body>
</html>