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

Unified Diff: Source/core/fetch/FontResource.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/FontResource.h ('k') | Source/core/fetch/ImageResource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/FontResource.cpp
diff --git a/Source/core/fetch/FontResource.cpp b/Source/core/fetch/FontResource.cpp
index e2bd3a81aeb0f138c17cd0111ae2dc349aada25d..f3f023cf6ed28356dc72a57e7fd6fe354f745405 100644
--- a/Source/core/fetch/FontResource.cpp
+++ b/Source/core/fetch/FontResource.cpp
@@ -27,7 +27,9 @@
#include "config.h"
#include "core/fetch/FontResource.h"
+#include "core/fetch/FetchRequest.h"
#include "core/fetch/ResourceClientWalker.h"
+#include "core/fetch/ResourceFetcher.h"
#include "platform/SharedBuffer.h"
#include "platform/fonts/FontCustomPlatformData.h"
#include "platform/fonts/FontPlatformData.h"
@@ -65,6 +67,13 @@ static void recordPackageFormatHistogram(FontPackageFormat format)
Platform::current()->histogramEnumeration("WebFont.PackageFormat", format, PackageFormatEnumMax);
}
+ResourcePtr<FontResource> FontResource::fetch(FetchRequest& request, ResourceFetcher* fetcher)
+{
+ ASSERT(request.resourceRequest().frameType() == WebURLRequest::FrameTypeNone);
+ request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestContextFont);
+ return toFontResource(fetcher->requestResource(request, FontResourceFactory()));
+}
+
FontResource::FontResource(const ResourceRequest& resourceRequest)
: Resource(resourceRequest, Font)
, m_state(Unloaded)
« no previous file with comments | « Source/core/fetch/FontResource.h ('k') | Source/core/fetch/ImageResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698