<!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>[203079] 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/203079">203079</a></dd>
<dt>Author</dt> <dd>ryanhaddad@apple.com</dd>
<dt>Date</dt> <dd>2016-07-11 13:11:03 -0700 (Mon, 11 Jul 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/203064">r203064</a>.
https://bugs.webkit.org/show_bug.cgi?id=159642
This change causes LayoutTest crashes on WK1 ASan (Requested
by ryanhaddad on #webkit).
Reverted changeset:
"Use refs for ResourceLoaders"
https://bugs.webkit.org/show_bug.cgi?id=159592
http://trac.webkit.org/changeset/203064
Patch by Commit Queue <commit-queue@webkit.org> on 2016-07-11</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderLoaderStrategyh">trunk/Source/WebCore/loader/LoaderStrategy.h</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadercpp">trunk/Source/WebCore/loader/ResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebCoreSupportWebResourceLoadSchedulercpp">trunk/Source/WebKit/WebCoreSupport/WebResourceLoadScheduler.cpp</a></li>
<li><a href="#trunkSourceWebKitWebCoreSupportWebResourceLoadSchedulerh">trunk/Source/WebKit/WebCoreSupport/WebResourceLoadScheduler.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkWebLoaderStrategycpp">trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkWebLoaderStrategyh">trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203078 => 203079)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-11 19:50:40 UTC (rev 203078)
+++ trunk/Source/WebCore/ChangeLog        2016-07-11 20:11:03 UTC (rev 203079)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-07-11 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r203064.
+ https://bugs.webkit.org/show_bug.cgi?id=159642
+
+ This change causes LayoutTest crashes on WK1 ASan (Requested
+ by ryanhaddad on #webkit).
+
+ Reverted changeset:
+
+ "Use refs for ResourceLoaders"
+ https://bugs.webkit.org/show_bug.cgi?id=159592
+ http://trac.webkit.org/changeset/203064
+
</ins><span class="cx"> 2016-07-11 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> [WebGL] Check for existing buffer exists for enabled vertex array attributes before permitting glDrawArrays to execute
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderLoaderStrategyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/LoaderStrategy.h (203078 => 203079)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/LoaderStrategy.h        2016-07-11 19:50:40 UTC (rev 203078)
+++ trunk/Source/WebCore/loader/LoaderStrategy.h        2016-07-11 20:11:03 UTC (rev 203079)
</span><span class="lines">@@ -51,9 +51,9 @@
</span><span class="cx"> virtual RefPtr<SubresourceLoader> loadResource(Frame&, CachedResource&, const ResourceRequest&, const ResourceLoaderOptions&) = 0;
</span><span class="cx"> virtual void loadResourceSynchronously(NetworkingContext*, unsigned long identifier, const ResourceRequest&, StoredCredentials, ClientCredentialPolicy, ResourceError&, ResourceResponse&, Vector<char>& data) = 0;
</span><span class="cx">
</span><del>- virtual void remove(ResourceLoader&) = 0;
- virtual void setDefersLoading(ResourceLoader&, bool) = 0;
- virtual void crossOriginRedirectReceived(ResourceLoader&, const URL& redirectURL) = 0;
</del><ins>+ virtual void remove(ResourceLoader*) = 0;
+ virtual void setDefersLoading(ResourceLoader*, bool) = 0;
+ virtual void crossOriginRedirectReceived(ResourceLoader*, const URL& redirectURL) = 0;
</ins><span class="cx">
</span><span class="cx"> virtual void servePendingRequests(ResourceLoadPriority minimumPriority = ResourceLoadPriority::VeryLow) = 0;
</span><span class="cx"> virtual void suspendPendingRequests() = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (203078 => 203079)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.cpp        2016-07-11 19:50:40 UTC (rev 203078)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp        2016-07-11 20:11:03 UTC (rev 203079)
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx">
</span><span class="cx"> void ResourceLoader::finishNetworkLoad()
</span><span class="cx"> {
</span><del>- platformStrategies()->loaderStrategy()->remove(*this);
</del><ins>+ platformStrategies()->loaderStrategy()->remove(this);
</ins><span class="cx">
</span><span class="cx"> if (m_handle) {
</span><span class="cx"> ASSERT(m_handle->client() == this);
</span><span class="lines">@@ -223,7 +223,7 @@
</span><span class="cx"> start();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- platformStrategies()->loaderStrategy()->setDefersLoading(*this, defers);
</del><ins>+ platformStrategies()->loaderStrategy()->setDefersLoading(this, defers);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> FrameLoader* ResourceLoader::frameLoader() const
</span><span class="lines">@@ -279,7 +279,7 @@
</span><span class="cx"> void ResourceLoader::willSwitchToSubstituteResource()
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!m_documentLoader->isSubstituteLoadPending(this));
</span><del>- platformStrategies()->loaderStrategy()->remove(*this);
</del><ins>+ platformStrategies()->loaderStrategy()->remove(this);
</ins><span class="cx"> if (m_handle)
</span><span class="cx"> m_handle->cancel();
</span><span class="cx"> }
</span><span class="lines">@@ -367,7 +367,7 @@
</span><span class="cx">
</span><span class="cx"> bool isRedirect = !redirectResponse.isNull();
</span><span class="cx"> if (isRedirect)
</span><del>- platformStrategies()->loaderStrategy()->crossOriginRedirectReceived(*this, request.url());
</del><ins>+ platformStrategies()->loaderStrategy()->crossOriginRedirectReceived(this, request.url());
</ins><span class="cx">
</span><span class="cx"> m_request = request;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (203078 => 203079)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog        2016-07-11 19:50:40 UTC (rev 203078)
+++ trunk/Source/WebKit/ChangeLog        2016-07-11 20:11:03 UTC (rev 203079)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-07-11 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r203064.
+ https://bugs.webkit.org/show_bug.cgi?id=159642
+
+ This change causes LayoutTest crashes on WK1 ASan (Requested
+ by ryanhaddad on #webkit).
+
+ Reverted changeset:
+
+ "Use refs for ResourceLoaders"
+ https://bugs.webkit.org/show_bug.cgi?id=159592
+ http://trac.webkit.org/changeset/203064
+
</ins><span class="cx"> 2016-07-08 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><span class="cx"> Use refs for ResourceLoaders
</span></span></pre></div>
<a id="trunkSourceWebKitWebCoreSupportWebResourceLoadSchedulercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebCoreSupport/WebResourceLoadScheduler.cpp (203078 => 203079)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebCoreSupport/WebResourceLoadScheduler.cpp        2016-07-11 19:50:40 UTC (rev 203078)
+++ trunk/Source/WebKit/WebCoreSupport/WebResourceLoadScheduler.cpp        2016-07-11 20:11:03 UTC (rev 203079)
</span><span class="lines">@@ -67,21 +67,20 @@
</span><span class="cx"> WebResourceLoadScheduler::HostInformation* WebResourceLoadScheduler::hostForURL(const URL& url, CreateHostPolicy createHostPolicy)
</span><span class="cx"> {
</span><span class="cx"> if (!url.protocolIsInHTTPFamily())
</span><del>- return &m_nonHTTPProtocolHost;
</del><ins>+ return m_nonHTTPProtocolHost;
</ins><span class="cx">
</span><span class="cx"> m_hosts.checkConsistency();
</span><span class="cx"> String hostName = url.host();
</span><span class="cx"> HostInformation* host = m_hosts.get(hostName);
</span><span class="cx"> if (!host && createHostPolicy == CreateIfNotFound) {
</span><del>- auto newHost = std::make_unique<HostInformation>(hostName, maxRequestsInFlightPerHost);
- host = newHost.get();
- m_hosts.add(hostName, WTFMove(newHost));
</del><ins>+ host = new HostInformation(hostName, maxRequestsInFlightPerHost);
+ m_hosts.add(hostName, host);
</ins><span class="cx"> }
</span><span class="cx"> return host;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> WebResourceLoadScheduler::WebResourceLoadScheduler()
</span><del>- : m_nonHTTPProtocolHost(String(), maxRequestsInFlightForNonHTTPProtocols)
</del><ins>+ : m_nonHTTPProtocolHost(new HostInformation(String(), maxRequestsInFlightForNonHTTPProtocols))
</ins><span class="cx"> , m_requestTimer(*this, &WebResourceLoadScheduler::requestTimerFired)
</span><span class="cx"> , m_suspendPendingRequestsCount(0)
</span><span class="cx"> , m_isSerialLoadingEnabled(false)
</span><span class="lines">@@ -97,7 +96,7 @@
</span><span class="cx"> {
</span><span class="cx"> RefPtr<SubresourceLoader> loader = SubresourceLoader::create(frame, resource, request, options);
</span><span class="cx"> if (loader)
</span><del>- scheduleLoad(*loader);
</del><ins>+ scheduleLoad(loader.get());
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> // Since we defer loader initialization until scheduling on iOS, the frame
</span><span class="cx"> // load delegate that would be called in SubresourceLoader::create() on
</span><span class="lines">@@ -119,35 +118,36 @@
</span><span class="cx"> {
</span><span class="cx"> RefPtr<NetscapePlugInStreamLoader> loader = NetscapePlugInStreamLoader::create(frame, client, request);
</span><span class="cx"> if (loader)
</span><del>- scheduleLoad(*loader);
</del><ins>+ scheduleLoad(loader.get());
</ins><span class="cx"> return loader;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebResourceLoadScheduler::scheduleLoad(ResourceLoader& resourceLoader)
</del><ins>+void WebResourceLoadScheduler::scheduleLoad(ResourceLoader* resourceLoader)
</ins><span class="cx"> {
</span><del>- LOG(ResourceLoading, "WebResourceLoadScheduler::load resource %p '%s'", &resourceLoader, resourceLoader.url().string().latin1().data());
</del><ins>+ ASSERT(resourceLoader);
</ins><span class="cx">
</span><ins>+ LOG(ResourceLoading, "WebResourceLoadScheduler::load resource %p '%s'", resourceLoader, resourceLoader->url().string().latin1().data());
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> // If there's a web archive resource for this URL, we don't need to schedule the load since it will never touch the network.
</span><del>- if (!isSuspendingPendingRequests() && resourceLoader.documentLoader()->archiveResourceForURL(resourceLoader.iOSOriginalRequest().url())) {
- resourceLoader.startLoading();
</del><ins>+ if (!isSuspendingPendingRequests() && resourceLoader->documentLoader()->archiveResourceForURL(resourceLoader->iOSOriginalRequest().url())) {
+ resourceLoader->startLoading();
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> #else
</span><del>- if (resourceLoader.documentLoader()->archiveResourceForURL(resourceLoader.request().url())) {
- resourceLoader.start();
</del><ins>+ if (resourceLoader->documentLoader()->archiveResourceForURL(resourceLoader->request().url())) {
+ resourceLoader->start();
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>- HostInformation* host = hostForURL(resourceLoader.iOSOriginalRequest().url(), CreateIfNotFound);
</del><ins>+ HostInformation* host = hostForURL(resourceLoader->iOSOriginalRequest().url(), CreateIfNotFound);
</ins><span class="cx"> #else
</span><del>- HostInformation* host = hostForURL(resourceLoader.url(), CreateIfNotFound);
</del><ins>+ HostInformation* host = hostForURL(resourceLoader->url(), CreateIfNotFound);
</ins><span class="cx"> #endif
</span><del>- ASSERT(host);
</del><span class="cx">
</span><del>- ResourceLoadPriority priority = resourceLoader.request().priority();
</del><ins>+ ResourceLoadPriority priority = resourceLoader->request().priority();
</ins><span class="cx">
</span><span class="cx"> bool hadRequests = host->hasRequests();
</span><span class="cx"> host->schedule(resourceLoader, priority);
</span><span class="lines">@@ -156,21 +156,21 @@
</span><span class="cx"> if (ResourceRequest::resourcePrioritiesEnabled() && !isSuspendingPendingRequests()) {
</span><span class="cx"> // Serve all requests at once to keep the pipeline full at the network layer.
</span><span class="cx"> // FIXME: Does this code do anything useful, given that we also set maxRequestsInFlightPerHost to effectively unlimited on these platforms?
</span><del>- servePendingRequests(*host, ResourceLoadPriority::VeryLow);
</del><ins>+ servePendingRequests(host, ResourceLoadPriority::VeryLow);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>- if ((priority > ResourceLoadPriority::Low || !resourceLoader.iOSOriginalRequest().url().protocolIsInHTTPFamily() || (priority == ResourceLoadPriority::Low && !hadRequests)) && !isSuspendingPendingRequests()) {
</del><ins>+ if ((priority > ResourceLoadPriority::Low || !resourceLoader->iOSOriginalRequest().url().protocolIsInHTTPFamily() || (priority == ResourceLoadPriority::Low && !hadRequests)) && !isSuspendingPendingRequests()) {
</ins><span class="cx"> // Try to request important resources immediately.
</span><del>- servePendingRequests(*host, priority);
</del><ins>+ servePendingRequests(host, priority);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> #else
</span><del>- if (priority > ResourceLoadPriority::Low || !resourceLoader.url().protocolIsInHTTPFamily() || (priority == ResourceLoadPriority::Low && !hadRequests)) {
</del><ins>+ if (priority > ResourceLoadPriority::Low || !resourceLoader->url().protocolIsInHTTPFamily() || (priority == ResourceLoadPriority::Low && !hadRequests)) {
</ins><span class="cx"> // Try to request important resources immediately.
</span><del>- servePendingRequests(*host, priority);
</del><ins>+ servePendingRequests(host, priority);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -180,16 +180,18 @@
</span><span class="cx"> scheduleServePendingRequests();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebResourceLoadScheduler::remove(ResourceLoader& resourceLoader)
</del><ins>+void WebResourceLoadScheduler::remove(ResourceLoader* resourceLoader)
</ins><span class="cx"> {
</span><del>- HostInformation* host = hostForURL(resourceLoader.url());
</del><ins>+ ASSERT(resourceLoader);
+
+ HostInformation* host = hostForURL(resourceLoader->url());
</ins><span class="cx"> if (host)
</span><span class="cx"> host->remove(resourceLoader);
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> // ResourceLoader::url() doesn't start returning the correct value until the load starts. If we get canceled before that, we need to look for originalRequest url instead.
</span><span class="cx"> // FIXME: ResourceLoader::url() should be made to return a sensible value at all times.
</span><del>- if (!resourceLoader.iOSOriginalRequest().isNull()) {
- HostInformation* originalHost = hostForURL(resourceLoader.iOSOriginalRequest().url());
</del><ins>+ if (!resourceLoader->iOSOriginalRequest().isNull()) {
+ HostInformation* originalHost = hostForURL(resourceLoader->iOSOriginalRequest().url());
</ins><span class="cx"> if (originalHost && originalHost != host)
</span><span class="cx"> originalHost->remove(resourceLoader);
</span><span class="cx"> }
</span><span class="lines">@@ -197,19 +199,18 @@
</span><span class="cx"> scheduleServePendingRequests();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebResourceLoadScheduler::setDefersLoading(ResourceLoader&, bool)
</del><ins>+void WebResourceLoadScheduler::setDefersLoading(ResourceLoader*, bool)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebResourceLoadScheduler::crossOriginRedirectReceived(ResourceLoader& resourceLoader, const URL& redirectURL)
</del><ins>+void WebResourceLoadScheduler::crossOriginRedirectReceived(ResourceLoader* resourceLoader, const URL& redirectURL)
</ins><span class="cx"> {
</span><del>- HostInformation* oldHost = hostForURL(resourceLoader.url());
</del><ins>+ HostInformation* oldHost = hostForURL(resourceLoader->url());
</ins><span class="cx"> ASSERT(oldHost);
</span><span class="cx"> if (!oldHost)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> HostInformation* newHost = hostForURL(redirectURL, CreateIfNotFound);
</span><del>- ASSERT(newHost);
</del><span class="cx">
</span><span class="cx"> if (oldHost->name() == newHost->name())
</span><span class="cx"> return;
</span><span class="lines">@@ -229,38 +230,36 @@
</span><span class="cx"> servePendingRequests(m_nonHTTPProtocolHost, minimumPriority);
</span><span class="cx">
</span><span class="cx"> Vector<HostInformation*> hostsToServe;
</span><del>- hostsToServe.reserveInitialCapacity(m_hosts.size());
- for (const auto& host : m_hosts.values())
- hostsToServe.uncheckedAppend(host.get());
</del><ins>+ copyValuesToVector(m_hosts, hostsToServe);
</ins><span class="cx">
</span><span class="cx"> for (auto* host : hostsToServe) {
</span><span class="cx"> if (host->hasRequests())
</span><del>- servePendingRequests(*host, minimumPriority);
</del><ins>+ servePendingRequests(host, minimumPriority);
</ins><span class="cx"> else
</span><del>- m_hosts.remove(host->name());
</del><ins>+ delete m_hosts.take(host->name());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebResourceLoadScheduler::servePendingRequests(HostInformation& host, ResourceLoadPriority minimumPriority)
</del><ins>+void WebResourceLoadScheduler::servePendingRequests(HostInformation* host, ResourceLoadPriority minimumPriority)
</ins><span class="cx"> {
</span><del>- LOG(ResourceLoading, "WebResourceLoadScheduler::servePendingRequests HostInformation.m_name='%s'", host.name().latin1().data());
</del><ins>+ LOG(ResourceLoading, "WebResourceLoadScheduler::servePendingRequests HostInformation.m_name='%s'", host->name().latin1().data());
</ins><span class="cx">
</span><span class="cx"> auto priority = ResourceLoadPriority::Highest;
</span><span class="cx"> while (true) {
</span><del>- auto& requestsPending = host.requestsPending(priority);
</del><ins>+ auto& requestsPending = host->requestsPending(priority);
</ins><span class="cx"> while (!requestsPending.isEmpty()) {
</span><del>- Ref<ResourceLoader> resourceLoader = requestsPending.first().copyRef();
</del><ins>+ RefPtr<ResourceLoader> resourceLoader = requestsPending.first();
</ins><span class="cx">
</span><span class="cx"> // For named hosts - which are only http(s) hosts - we should always enforce the connection limit.
</span><span class="cx"> // For non-named hosts - everything but http(s) - we should only enforce the limit if the document isn't done parsing
</span><span class="cx"> // and we don't know all stylesheets yet.
</span><span class="cx"> Document* document = resourceLoader->frameLoader() ? resourceLoader->frameLoader()->frame().document() : 0;
</span><del>- bool shouldLimitRequests = !host.name().isNull() || (document && (document->parsing() || !document->haveStylesheetsLoaded()));
- if (shouldLimitRequests && host.limitRequests(priority))
</del><ins>+ bool shouldLimitRequests = !host->name().isNull() || (document && (document->parsing() || !document->haveStylesheetsLoaded()));
+ if (shouldLimitRequests && host->limitRequests(priority))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> requestsPending.removeFirst();
</span><del>- host.addLoadInProgress(resourceLoader.get());
</del><ins>+ host->addLoadInProgress(resourceLoader.get());
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> if (!IOSApplication::isWebProcess()) {
</span><span class="cx"> resourceLoader->startLoading();
</span><span class="lines">@@ -286,7 +285,7 @@
</span><span class="cx"> --m_suspendPendingRequestsCount;
</span><span class="cx"> if (m_suspendPendingRequestsCount)
</span><span class="cx"> return;
</span><del>- if (!m_hosts.isEmpty() || m_nonHTTPProtocolHost.hasRequests())
</del><ins>+ if (!m_hosts.isEmpty() || m_nonHTTPProtocolHost->hasRequests())
</ins><span class="cx"> scheduleServePendingRequests();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -332,18 +331,18 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebResourceLoadScheduler::HostInformation::schedule(ResourceLoader& resourceLoader, ResourceLoadPriority priority)
</del><ins>+void WebResourceLoadScheduler::HostInformation::schedule(ResourceLoader* resourceLoader, ResourceLoadPriority priority)
</ins><span class="cx"> {
</span><span class="cx"> m_requestsPending[priorityToIndex(priority)].append(resourceLoader);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebResourceLoadScheduler::HostInformation::addLoadInProgress(ResourceLoader& resourceLoader)
</del><ins>+void WebResourceLoadScheduler::HostInformation::addLoadInProgress(ResourceLoader* resourceLoader)
</ins><span class="cx"> {
</span><del>- LOG(ResourceLoading, "HostInformation '%s' loading '%s'. Current count %d", m_name.latin1().data(), resourceLoader.url().string().latin1().data(), m_requestsLoading.size());
</del><ins>+ LOG(ResourceLoading, "HostInformation '%s' loading '%s'. Current count %d", m_name.latin1().data(), resourceLoader->url().string().latin1().data(), m_requestsLoading.size());
</ins><span class="cx"> m_requestsLoading.add(resourceLoader);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebResourceLoadScheduler::HostInformation::remove(ResourceLoader& resourceLoader)
</del><ins>+void WebResourceLoadScheduler::HostInformation::remove(ResourceLoader* resourceLoader)
</ins><span class="cx"> {
</span><span class="cx"> if (m_requestsLoading.remove(resourceLoader))
</span><span class="cx"> return;
</span><span class="lines">@@ -350,7 +349,7 @@
</span><span class="cx">
</span><span class="cx"> for (auto& requestQueue : m_requestsPending) {
</span><span class="cx"> for (auto it = requestQueue.begin(), end = requestQueue.end(); it != end; ++it) {
</span><del>- if (it->ptr() == &resourceLoader) {
</del><ins>+ if (*it == resourceLoader) {
</ins><span class="cx"> requestQueue.remove(it);
</span><span class="cx"> return;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitWebCoreSupportWebResourceLoadSchedulerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebCoreSupport/WebResourceLoadScheduler.h (203078 => 203079)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebCoreSupport/WebResourceLoadScheduler.h        2016-07-11 19:50:40 UTC (rev 203078)
+++ trunk/Source/WebKit/WebCoreSupport/WebResourceLoadScheduler.h        2016-07-11 20:11:03 UTC (rev 203079)
</span><span class="lines">@@ -20,7 +20,8 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#pragma once
</del><ins>+#ifndef WebResourceLoadScheduler_h
+#define WebResourceLoadScheduler_h
</ins><span class="cx">
</span><span class="cx"> #include <WebCore/FrameLoaderTypes.h>
</span><span class="cx"> #include <WebCore/LoaderStrategy.h>
</span><span class="lines">@@ -46,9 +47,9 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<WebCore::SubresourceLoader> loadResource(WebCore::Frame&, WebCore::CachedResource&, const WebCore::ResourceRequest&, const WebCore::ResourceLoaderOptions&) override;
</span><span class="cx"> void loadResourceSynchronously(WebCore::NetworkingContext*, unsigned long, const WebCore::ResourceRequest&, WebCore::StoredCredentials, WebCore::ClientCredentialPolicy, WebCore::ResourceError&, WebCore::ResourceResponse&, Vector<char>&) override;
</span><del>- void remove(WebCore::ResourceLoader&) override;
- void setDefersLoading(WebCore::ResourceLoader&, bool) override;
- void crossOriginRedirectReceived(WebCore::ResourceLoader&, const WebCore::URL& redirectURL) override;
</del><ins>+ void remove(WebCore::ResourceLoader*) override;
+ void setDefersLoading(WebCore::ResourceLoader*, bool) override;
+ void crossOriginRedirectReceived(WebCore::ResourceLoader*, const WebCore::URL& redirectURL) override;
</ins><span class="cx">
</span><span class="cx"> void servePendingRequests(WebCore::ResourceLoadPriority minimumPriority = WebCore::ResourceLoadPriority::VeryLow) override;
</span><span class="cx"> void suspendPendingRequests() override;
</span><span class="lines">@@ -65,7 +66,7 @@
</span><span class="cx"> virtual ~WebResourceLoadScheduler();
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- void scheduleLoad(WebCore::ResourceLoader&);
</del><ins>+ void scheduleLoad(WebCore::ResourceLoader*);
</ins><span class="cx"> void scheduleServePendingRequests();
</span><span class="cx"> void requestTimerFired();
</span><span class="cx">
</span><span class="lines">@@ -78,13 +79,13 @@
</span><span class="cx"> ~HostInformation();
</span><span class="cx">
</span><span class="cx"> const String& name() const { return m_name; }
</span><del>- void schedule(WebCore::ResourceLoader&, WebCore::ResourceLoadPriority = WebCore::ResourceLoadPriority::VeryLow);
- void addLoadInProgress(WebCore::ResourceLoader&);
- void remove(WebCore::ResourceLoader&);
</del><ins>+ void schedule(WebCore::ResourceLoader*, WebCore::ResourceLoadPriority = WebCore::ResourceLoadPriority::VeryLow);
+ void addLoadInProgress(WebCore::ResourceLoader*);
+ void remove(WebCore::ResourceLoader*);
</ins><span class="cx"> bool hasRequests() const;
</span><span class="cx"> bool limitRequests(WebCore::ResourceLoadPriority) const;
</span><span class="cx">
</span><del>- typedef Deque<Ref<WebCore::ResourceLoader>> RequestQueue;
</del><ins>+ typedef Deque<RefPtr<WebCore::ResourceLoader>> RequestQueue;
</ins><span class="cx"> RequestQueue& requestsPending(WebCore::ResourceLoadPriority priority) { return m_requestsPending[priorityToIndex(priority)]; }
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="lines">@@ -91,7 +92,7 @@
</span><span class="cx"> static unsigned priorityToIndex(WebCore::ResourceLoadPriority);
</span><span class="cx">
</span><span class="cx"> std::array<RequestQueue, WebCore::resourceLoadPriorityCount> m_requestsPending;
</span><del>- typedef HashSet<Ref<WebCore::ResourceLoader>> RequestMap;
</del><ins>+ typedef HashSet<RefPtr<WebCore::ResourceLoader>> RequestMap;
</ins><span class="cx"> RequestMap m_requestsLoading;
</span><span class="cx"> const String m_name;
</span><span class="cx"> const unsigned m_maxRequestsInFlight;
</span><span class="lines">@@ -103,10 +104,11 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> HostInformation* hostForURL(const WebCore::URL&, CreateHostPolicy = FindOnly);
</span><del>- void servePendingRequests(HostInformation&, WebCore::ResourceLoadPriority);
</del><ins>+ WEBCORE_EXPORT void servePendingRequests(HostInformation*, WebCore::ResourceLoadPriority);
</ins><span class="cx">
</span><del>- HashMap<String, std::unique_ptr<HostInformation>> m_hosts;
- HostInformation m_nonHTTPProtocolHost;
</del><ins>+ typedef HashMap<String, HostInformation*, StringHash> HostMap;
+ HostMap m_hosts;
+ HostInformation* m_nonHTTPProtocolHost;
</ins><span class="cx">
</span><span class="cx"> WebCore::Timer m_requestTimer;
</span><span class="cx">
</span><span class="lines">@@ -113,3 +115,5 @@
</span><span class="cx"> unsigned m_suspendPendingRequestsCount;
</span><span class="cx"> bool m_isSerialLoadingEnabled;
</span><span class="cx"> };
</span><ins>+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (203078 => 203079)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-07-11 19:50:40 UTC (rev 203078)
+++ trunk/Source/WebKit2/ChangeLog        2016-07-11 20:11:03 UTC (rev 203079)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-07-11 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r203064.
+ https://bugs.webkit.org/show_bug.cgi?id=159642
+
+ This change causes LayoutTest crashes on WK1 ASan (Requested
+ by ryanhaddad on #webkit).
+
+ Reverted changeset:
+
+ "Use refs for ResourceLoaders"
+ https://bugs.webkit.org/show_bug.cgi?id=159592
+ http://trac.webkit.org/changeset/203064
+
</ins><span class="cx"> 2016-07-11 Nan Wang <n_wang@apple.com>
</span><span class="cx">
</span><span class="cx"> AX: WKWebView should have API to prevent pinch-to-zoom always being allowed
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkWebLoaderStrategycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp (203078 => 203079)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp        2016-07-11 19:50:40 UTC (rev 203078)
+++ trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp        2016-07-11 20:11:03 UTC (rev 203079)
</span><span class="lines">@@ -217,19 +217,17 @@
</span><span class="cx">
</span><span class="cx"> void WebLoaderStrategy::scheduleInternallyFailedLoad(WebCore::ResourceLoader& resourceLoader)
</span><span class="cx"> {
</span><del>- m_internallyFailedResourceLoaders.add(resourceLoader);
</del><ins>+ m_internallyFailedResourceLoaders.add(&resourceLoader);
</ins><span class="cx"> m_internallyFailedLoadTimer.startOneShot(0);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebLoaderStrategy::internallyFailedLoadTimerFired()
</span><span class="cx"> {
</span><del>- Vector<Ref<ResourceLoader>> internallyFailedResourceLoaders;
- internallyFailedResourceLoaders.reserveInitialCapacity(m_internallyFailedResourceLoaders.size());
- for (auto& loader : m_internallyFailedResourceLoaders)
- internallyFailedResourceLoaders.uncheckedAppend(loader.copyRef());
</del><ins>+ Vector<RefPtr<ResourceLoader>> internallyFailedResourceLoaders;
+ copyToVector(m_internallyFailedResourceLoaders, internallyFailedResourceLoaders);
</ins><span class="cx">
</span><del>- for (auto& loader : internallyFailedResourceLoaders)
- loader->didFail(internalError(loader->url()));
</del><ins>+ for (size_t i = 0; i < internallyFailedResourceLoaders.size(); ++i)
+ internallyFailedResourceLoaders[i]->didFail(internalError(internallyFailedResourceLoaders[i]->url()));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebLoaderStrategy::startLocalLoad(WebCore::ResourceLoader& resourceLoader)
</span><span class="lines">@@ -238,9 +236,10 @@
</span><span class="cx"> m_webResourceLoaders.set(resourceLoader.identifier(), WebResourceLoader::create(resourceLoader));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebLoaderStrategy::remove(ResourceLoader& resourceLoader)
</del><ins>+void WebLoaderStrategy::remove(ResourceLoader* resourceLoader)
</ins><span class="cx"> {
</span><del>- LOG(NetworkScheduling, "(WebProcess) WebLoaderStrategy::remove, url '%s'", resourceLoader.url().string().utf8().data());
</del><ins>+ ASSERT(resourceLoader);
+ LOG(NetworkScheduling, "(WebProcess) WebLoaderStrategy::remove, url '%s'", resourceLoader->url().string().utf8().data());
</ins><span class="cx">
</span><span class="cx"> if (m_internallyFailedResourceLoaders.contains(resourceLoader)) {
</span><span class="cx"> m_internallyFailedResourceLoaders.remove(resourceLoader);
</span><span class="lines">@@ -247,7 +246,7 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- ResourceLoadIdentifier identifier = resourceLoader.identifier();
</del><ins>+ ResourceLoadIdentifier identifier = resourceLoader->identifier();
</ins><span class="cx"> if (!identifier) {
</span><span class="cx"> LOG_ERROR("WebLoaderStrategy removing a ResourceLoader that has no identifier.");
</span><span class="cx"> return;
</span><span class="lines">@@ -265,13 +264,13 @@
</span><span class="cx"> loader->detachFromCoreLoader();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebLoaderStrategy::setDefersLoading(ResourceLoader& resourceLoader, bool defers)
</del><ins>+void WebLoaderStrategy::setDefersLoading(ResourceLoader* resourceLoader, bool defers)
</ins><span class="cx"> {
</span><del>- ResourceLoadIdentifier identifier = resourceLoader.identifier();
</del><ins>+ ResourceLoadIdentifier identifier = resourceLoader->identifier();
</ins><span class="cx"> WebProcess::singleton().networkConnection()->connection()->send(Messages::NetworkConnectionToWebProcess::SetDefersLoading(identifier, defers), 0);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebLoaderStrategy::crossOriginRedirectReceived(ResourceLoader&, const URL&)
</del><ins>+void WebLoaderStrategy::crossOriginRedirectReceived(ResourceLoader*, const URL&)
</ins><span class="cx"> {
</span><span class="cx"> // We handle cross origin redirects entirely within the NetworkProcess.
</span><span class="cx"> // We override this call in the WebProcess to make it a no-op.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkWebLoaderStrategyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.h (203078 => 203079)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.h        2016-07-11 19:50:40 UTC (rev 203078)
+++ trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.h        2016-07-11 20:11:03 UTC (rev 203079)
</span><span class="lines">@@ -46,9 +46,9 @@
</span><span class="cx"> RefPtr<WebCore::SubresourceLoader> loadResource(WebCore::Frame&, WebCore::CachedResource&, const WebCore::ResourceRequest&, const WebCore::ResourceLoaderOptions&) override;
</span><span class="cx"> void loadResourceSynchronously(WebCore::NetworkingContext*, unsigned long resourceLoadIdentifier, const WebCore::ResourceRequest&, WebCore::StoredCredentials, WebCore::ClientCredentialPolicy, WebCore::ResourceError&, WebCore::ResourceResponse&, Vector<char>& data) override;
</span><span class="cx">
</span><del>- void remove(WebCore::ResourceLoader&) override;
- void setDefersLoading(WebCore::ResourceLoader&, bool) override;
- void crossOriginRedirectReceived(WebCore::ResourceLoader&, const WebCore::URL& redirectURL) override;
</del><ins>+ void remove(WebCore::ResourceLoader*) override;
+ void setDefersLoading(WebCore::ResourceLoader*, bool) override;
+ void crossOriginRedirectReceived(WebCore::ResourceLoader*, const WebCore::URL& redirectURL) override;
</ins><span class="cx">
</span><span class="cx"> void servePendingRequests(WebCore::ResourceLoadPriority minimumPriority) override;
</span><span class="cx">
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx"> void internallyFailedLoadTimerFired();
</span><span class="cx"> void startLocalLoad(WebCore::ResourceLoader&);
</span><span class="cx">
</span><del>- HashSet<Ref<WebCore::ResourceLoader>> m_internallyFailedResourceLoaders;
</del><ins>+ HashSet<RefPtr<WebCore::ResourceLoader>> m_internallyFailedResourceLoaders;
</ins><span class="cx"> RunLoop::Timer<WebLoaderStrategy> m_internallyFailedLoadTimer;
</span><span class="cx">
</span><span class="cx"> HashMap<unsigned long, RefPtr<WebResourceLoader>> m_webResourceLoaders;
</span></span></pre>
</div>
</div>
</body>
</html>