Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Unified Diff: third_party/WebKit/Source/core/fetch/Resource.cpp

Issue 1889973002: Refactoring starting a resource load (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a browser_test Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/fetch/Resource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/Resource.cpp b/third_party/WebKit/Source/core/fetch/Resource.cpp
index 118fed26eb16d5bfc5959fce36e18b31174c5f19..f043b1bc93af6415e8a3f76d5950742a1286fdb4 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.cpp
+++ b/third_party/WebKit/Source/core/fetch/Resource.cpp
@@ -29,7 +29,6 @@
#include "core/fetch/MemoryCache.h"
#include "core/fetch/ResourceClient.h"
#include "core/fetch/ResourceClientOrObserverWalker.h"
-#include "core/fetch/ResourceFetcher.h"
#include "core/fetch/ResourceLoader.h"
#include "core/inspector/InstanceCounters.h"
#include "platform/Histogram.h"
@@ -332,24 +331,12 @@ DEFINE_TRACE(Resource)
visitor->trace(m_cacheHandler);
}
-void Resource::load(ResourceFetcher* fetcher)
+void Resource::setLoader(ResourceLoader* loader)
{
- // TOOD(japhet): Temporary, out of place hack to stop a top crasher.
- // Make this more organic.
- if (!fetcher->loadingTaskRunner())
- return;
-
RELEASE_ASSERT(!m_loader);
ASSERT(stillNeedsLoad());
+ m_loader = loader;
m_status = Pending;
-
- KURL url = m_resourceRequest.url();
- m_resourceRequest.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredCredentials);
-
- m_fetcherSecurityOrigin = fetcher->context().getSecurityOrigin();
- m_loader = ResourceLoader::create(fetcher, this);
- m_loader->start(m_resourceRequest);
- m_resourceRequest.setURL(url);
}
void Resource::checkNotify()
@@ -552,8 +539,6 @@ void Resource::willFollowRedirect(ResourceRequest& newRequest, const ResourceRes
{
if (m_isRevalidating)
revalidationFailed();
-
- newRequest.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredCredentials);
m_redirectChain.append(RedirectPair(newRequest, redirectResponse));
}
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.h ('k') | third_party/WebKit/Source/core/fetch/ResourceFetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698