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

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

Issue 2668603003: Make ResourceHandler::OnWillRead able to complete asynchronously. (Closed)
Patch Set: Response to 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: content/browser/loader/resource_handler.h
diff --git a/content/browser/loader/resource_handler.h b/content/browser/loader/resource_handler.h
index cf4a5a065b1b73b3d8ad96cfbf0028e392adf60f..c292cab2312b73082c8531f8e9d8c705f05e6556 100644
--- a/content/browser/loader/resource_handler.h
+++ b/content/browser/loader/resource_handler.h
@@ -106,12 +106,11 @@ class CONTENT_EXPORT ResourceHandler
// Unlike other methods, may be called synchronously on Resume, for
// performance reasons.
//
- // If the handler returns false, then the request is cancelled. Otherwise,
- // once data is available, OnReadCompleted will be called.
- // TODO(mmenke): Make this method use a ResourceController, and allow it to
- // succeed asynchronously.
- virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf,
- int* buf_size) = 0;
+ // The request will not continue until one of |controller|'s resume or
+ // cancellation methods is invoked.
+ virtual void OnWillRead(scoped_refptr<net::IOBuffer>* buf,
+ int* buf_size,
+ std::unique_ptr<ResourceController> controller) = 0;
// Data (*bytes_read bytes) was written into the buffer provided by
// OnWillRead. The request will not continue until one of |controller|'s
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_unittest.cc ('k') | content/browser/loader/resource_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698