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

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

Issue 2549093008: Loading: Use MockResource in ResourceFetcherTest.cpp (Closed)
Patch Set: [rebase] Created 4 years 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/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
index d62822a2d077530fabcd558c3d736450c24f771c..516325610dddc8c5c7192fc3900ccba6e0c11f40 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
@@ -88,6 +88,7 @@ enum SriResourceIntegrityMismatchEvent {
DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, MainResource) \
DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, Manifest) \
DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, Media) \
+ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, Mock) \
DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, Raw) \
DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, Script) \
DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, SVGDocument) \
@@ -132,6 +133,7 @@ ResourceLoadPriority typeToPriority(Resource::Type type) {
// Also visible resources/images (set explicitly in loadPriority)
return ResourceLoadPriorityHigh;
case Resource::Manifest:
+ case Resource::Mock:
// Also late-body scripts discovered by the preload scanner (set
// explicitly in loadPriority)
return ResourceLoadPriorityMedium;
@@ -237,6 +239,8 @@ static WebURLRequest::RequestContext requestContextFromType(
return WebURLRequest::RequestContextVideo;
case Resource::Manifest:
return WebURLRequest::RequestContextManifest;
+ case Resource::Mock:
+ return WebURLRequest::RequestContextSubresource;
}
NOTREACHED();
return WebURLRequest::RequestContextSubresource;
@@ -1372,6 +1376,9 @@ void ResourceFetcher::logPreloadStats(ClearPreloadsPolicy policy) {
raws++;
rawMisses += missCount;
break;
+ case Resource::Mock:
+ // Do not count Resource::Mock because this type is only for testing.
+ break;
default:
NOTREACHED();
}
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.cpp ('k') | third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698