Chromium Code Reviews| 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 |