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

Unified Diff: content/public/browser/navigation_throttle.h

Issue 1616943003: Teach navigation throttles how to cancel requests in WillProcessResponse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fiddling. Created 4 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
Index: content/public/browser/navigation_throttle.h
diff --git a/content/public/browser/navigation_throttle.h b/content/public/browser/navigation_throttle.h
index fff64b1f4fb8c61f425c27b140786fce5eaa617d..811d7230bd3105e4c26656002f2a60ae8b97a95b 100644
--- a/content/public/browser/navigation_throttle.h
+++ b/content/public/browser/navigation_throttle.h
@@ -55,6 +55,16 @@ class CONTENT_EXPORT NavigationThrottle {
// CANCEL_AND_IGNORE or DEFER and perform the destruction asynchronously.
virtual ThrottleCheckResult WillRedirectRequest();
+ // Called when a response's headers and metadata are available.
+ //
+ // The implementer is responsible for ensuring that the WebContents this
+ // throttle is associated with remain alive during the duration of this
+ // method. Failing to do so will result in use-after-free bugs. Should the
+ // implementer need to destroy the WebContents, it should return CANCEL,
+ // CANCEL_AND_IGNORE and perform the destruction asynchronously. The
clamy 2016/01/25 16:36:21 Let's remove last condition. There is one known ca
Mike West 2016/01/26 09:41:42 Done.
+ // implementer MUST NOT return DEFER.
+ virtual ThrottleCheckResult WillProcessResponse();
+
// The NavigationHandle that is tracking the information related to this
// navigation.
NavigationHandle* navigation_handle() const { return navigation_handle_; }

Powered by Google App Engine
This is Rietveld 408576698