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

Unified Diff: third_party/WebKit/Source/platform/loader/fetch/FetchContext.h

Issue 2747203002: Make prepareRequest() a separate callback of FetchContext (Closed)
Patch Set: addressed comments Created 3 years, 9 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/platform/loader/fetch/FetchContext.h
diff --git a/third_party/WebKit/Source/platform/loader/fetch/FetchContext.h b/third_party/WebKit/Source/platform/loader/fetch/FetchContext.h
index 921f5cbcf92988f33e9869a042bd8e344b6c264d..169f9630c7c02aa561e05f236d35a63cf9c71974 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/FetchContext.h
+++ b/third_party/WebKit/Source/platform/loader/fetch/FetchContext.h
@@ -89,12 +89,21 @@ class PLATFORM_EXPORT FetchContext
virtual void dispatchDidChangeResourcePriority(unsigned long identifier,
ResourceLoadPriority,
int intraPriorityValue);
+
+ // This internally dispatches WebFrameClient::willSendRequest and hooks
+ // request interceptors like ServiceWorker and ApplicationCache.
+ // This may modify the request.
+ enum class RedirectType { kForRedirect, kNotForRedirect };
+ virtual void prepareRequest(ResourceRequest&, RedirectType);
+
// The last callback before a request is actually sent to the browser process.
+ // TODO(https://crbug.com/632580): make this take const ResourceRequest&.
virtual void dispatchWillSendRequest(
unsigned long identifier,
ResourceRequest&,
const ResourceResponse& redirectResponse,
const FetchInitiatorInfo& = FetchInitiatorInfo());
+
virtual void dispatchDidLoadResourceFromMemoryCache(
unsigned long identifier,
Resource*,
@@ -123,14 +132,14 @@ class PLATFORM_EXPORT FetchContext
bool isInternalRequest);
virtual bool shouldLoadNewResource(Resource::Type) const { return false; }
+
// Called when a resource load is first requested, which may not be when the
// load actually begins.
- enum class V8ActivityLoggingPolicy { SuppressLogging, Log };
- virtual void willStartLoadingResource(unsigned long identifier,
- ResourceRequest&,
- Resource::Type,
- const AtomicString& fetchInitiatorName,
- V8ActivityLoggingPolicy);
+ virtual void recordLoadingActivity(unsigned long identifier,
+ const ResourceRequest&,
+ Resource::Type,
+ const AtomicString& fetchInitiatorName);
+
virtual void didLoadResource(Resource*);
virtual void addResourceTiming(const ResourceTimingInfo&);

Powered by Google App Engine
This is Rietveld 408576698