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

Unified Diff: Source/core/html/HTMLImportLoader.cpp

Issue 137983010: (Re)organize handling of CORS access control during resource loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: HTMLImportLoader no longer needs a ResourceFetcher Created 6 years, 11 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
« no previous file with comments | « Source/core/html/HTMLImportLoader.h ('k') | Source/core/html/parser/HTMLScriptRunner.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLImportLoader.cpp
diff --git a/Source/core/html/HTMLImportLoader.cpp b/Source/core/html/HTMLImportLoader.cpp
index eb214d8537d81172fa63091b972c3807e11e41b8..da4618eb211de3b0e099e3c15c17381a4a182301 100644
--- a/Source/core/html/HTMLImportLoader.cpp
+++ b/Source/core/html/HTMLImportLoader.cpp
@@ -42,15 +42,8 @@
namespace WebCore {
-PassRefPtr<HTMLImportLoader> HTMLImportLoader::create(HTMLImport* import, ResourceFetcher* fetcher)
-{
- RefPtr<HTMLImportLoader> self = adoptRef(new HTMLImportLoader(import, fetcher));
- return self.release();
-}
-
-HTMLImportLoader::HTMLImportLoader(HTMLImport* import, ResourceFetcher* fetcher)
+HTMLImportLoader::HTMLImportLoader(HTMLImport* import)
: m_import(import)
- , m_fetcher(fetcher)
, m_state(StateLoading)
{
}
@@ -68,12 +61,12 @@ void HTMLImportLoader::startLoading(const ResourcePtr<RawResource>& resource)
void HTMLImportLoader::responseReceived(Resource* resource, const ResourceResponse& response)
{
- // Current canAccess() implementation isn't sufficient for catching cross-domain redirects: http://crbug.com/256976
- if (!m_fetcher->canAccess(resource, PotentiallyCORSEnabled)) {
+ // Resource may already have been loaded with the import loader
+ // being added as a client later & now being notified. Fail early.
+ if (resource->loadFailedOrCanceled()) {
setState(StateError);
return;
}
-
setState(startWritingAndParsing(response));
}
@@ -169,5 +162,4 @@ void HTMLImportLoader::removeClient(HTMLImportLoaderClient* client)
m_clients.remove(m_clients.find(client));
}
-
} // namespace WebCore
« no previous file with comments | « Source/core/html/HTMLImportLoader.h ('k') | Source/core/html/parser/HTMLScriptRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698