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

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

Issue 2535723005: Stop using ResourceController in ResourceThrottle (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
« no previous file with comments | « content/browser/loader/throttling_resource_handler.cc ('k') | content/public/browser/resource_throttle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/resource_throttle.h
diff --git a/content/public/browser/resource_throttle.h b/content/public/browser/resource_throttle.h
index da1054c86cfb5c26bf2890fa82190fcb934c2400..53bae0682ffd53ee4a439ac09639b34bfbb8755d 100644
--- a/content/public/browser/resource_throttle.h
+++ b/content/public/browser/resource_throttle.h
@@ -24,6 +24,17 @@ class ThrottlingResourceHandler;
// time.
class CONTENT_EXPORT ResourceThrottle {
public:
+ class CONTENT_EXPORT Delegate {
+ public:
+ virtual void Cancel() = 0;
jochen (gone - plz use gerrit) 2016/12/05 15:25:03 please add comments explaining the delegate and ev
tyoshino (SeeGerritForStatus) 2016/12/06 11:25:31 Done.
+ virtual void CancelAndIgnore() = 0;
+ virtual void CancelWithError(int error_code) = 0;
+ virtual void Resume() = 0;
+
+ protected:
+ virtual ~Delegate() {}
+ };
+
virtual ~ResourceThrottle() {}
// Called before the resource request is started.
@@ -51,20 +62,22 @@ class CONTENT_EXPORT ResourceThrottle {
// WillProcessResponse.
virtual bool MustProcessResponseBeforeReadingBody();
- void set_controller_for_testing(ResourceController* c) {
- controller_ = c;
- }
+ void set_delegate_for_testing(Delegate* delegate) { delegate_ = delegate; }
protected:
- ResourceThrottle() : controller_(nullptr) {}
- ResourceController* controller() { return controller_; }
+ ResourceThrottle() : delegate_(nullptr) {}
+
+ void Cancel();
jochen (gone - plz use gerrit) 2016/12/05 15:25:03 please add comments here as well
tyoshino (SeeGerritForStatus) 2016/12/06 11:25:31 Done.
+ void CancelAndIgnore();
+ void CancelWithError(int error_code);
+ void Resume();
private:
friend class AsyncRevalidationDriver;
friend class ThrottlingResourceHandler;
- void set_controller(ResourceController* c) { controller_ = c; }
+ void set_delegate(Delegate* delegate) { delegate_ = delegate; }
- ResourceController* controller_;
+ Delegate* delegate_;
};
} // namespace content
« no previous file with comments | « content/browser/loader/throttling_resource_handler.cc ('k') | content/public/browser/resource_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698