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

Unified Diff: Source/core/fetch/ScriptResource.cpp

Issue 1170503003: Remove resource type-specific fetching logic from ResourceFetcher (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Null-check Document::loader() before calling startPreload() Created 5 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
« no previous file with comments | « Source/core/fetch/ScriptResource.h ('k') | Source/core/fetch/XSLStyleSheetResource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ScriptResource.cpp
diff --git a/Source/core/fetch/ScriptResource.cpp b/Source/core/fetch/ScriptResource.cpp
index c7ef8c0d33faf25521c6e2a91e931ee4f771b9b1..347de8c64735c7c9973b08253083e3c32f3f3d9b 100644
--- a/Source/core/fetch/ScriptResource.cpp
+++ b/Source/core/fetch/ScriptResource.cpp
@@ -27,13 +27,22 @@
#include "config.h"
#include "core/fetch/ScriptResource.h"
+#include "core/fetch/FetchRequest.h"
#include "core/fetch/ResourceClientWalker.h"
+#include "core/fetch/ResourceFetcher.h"
#include "platform/MIMETypeRegistry.h"
#include "platform/SharedBuffer.h"
#include "platform/network/HTTPParsers.h"
namespace blink {
+ResourcePtr<ScriptResource> ScriptResource::fetch(FetchRequest& request, ResourceFetcher* fetcher)
+{
+ ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone);
+ request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestContextScript);
+ return toScriptResource(fetcher->requestResource(request, ScriptResourceFactory()));
+}
+
ScriptResource::ScriptResource(const ResourceRequest& resourceRequest, const String& charset)
: TextResource(resourceRequest, Script, "application/javascript", charset)
{
« no previous file with comments | « Source/core/fetch/ScriptResource.h ('k') | Source/core/fetch/XSLStyleSheetResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698