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

Unified Diff: content/browser/loader/intercepting_resource_handler.h

Issue 2476163003: Refactor ResourceHandler API. (Closed)
Patch Set: Minor cleanups, one real fix Created 4 years, 1 month 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/browser/loader/intercepting_resource_handler.h
diff --git a/content/browser/loader/intercepting_resource_handler.h b/content/browser/loader/intercepting_resource_handler.h
index 3c796a406f67d2eb44609979529ba7c5a382470d..eb2150999cc94925776e93e596044423f97ca0bb 100644
--- a/content/browser/loader/intercepting_resource_handler.h
+++ b/content/browser/loader/intercepting_resource_handler.h
@@ -42,11 +42,12 @@ class CONTENT_EXPORT InterceptingResourceHandler
// ResourceHandler implementation:
void SetController(ResourceController* controller) override;
- bool OnResponseStarted(ResourceResponse* response, bool* defer) override;
+ void OnResponseStarted(ResourceResponse* response,
+ bool* defer_or_cancel) override;
bool OnWillRead(scoped_refptr<net::IOBuffer>* buf,
int* buf_size,
int min_size) override;
- bool OnReadCompleted(int bytes_read, bool* defer) override;
+ void OnReadCompleted(int bytes_read, bool* defer_or_cancel) override;
void OnResponseCompleted(const net::URLRequestStatus& status,
bool* defer) override;
@@ -108,15 +109,15 @@ class CONTENT_EXPORT InterceptingResourceHandler
PASS_THROUGH,
};
- // Runs necessary operations depending on |state_|. Returns false when an
- // error happens, and set |*defer| to true if the operation continues upon
- // return.
- bool DoLoop(bool* defer);
+ // Runs necessary operations depending on |state_|. Set |*defer_or_cancel| to
+ // true if the operation is not yet complete, and will invoke Resume() or
+ // Cancel() in the future, or if Cancel() was invoked synchronously.
+ void DoLoop(bool* defer_or_cancel);
- // The return value and |defer| has the same meaning as DoLoop.
- bool SendPayloadToOldHandler(bool* defer);
- bool SendFirstReadBufferToNewHandler(bool* defer);
- bool SendOnResponseStartedToNewHandler(bool* defer);
+ // |defer_or_cancel| has the same meaning as DoLoop.
+ void SendPayloadToOldHandler(bool* defer_or_cancel);
+ void SendFirstReadBufferToNewHandler(bool* defer_or_cancel);
+ void SendOnResponseStartedToNewHandler(bool* defer_or_cancel);
State state_ = State::STARTING;
« no previous file with comments | « content/browser/loader/detachable_resource_handler.cc ('k') | content/browser/loader/intercepting_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698