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

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

Issue 2467833002: Implement redirect handling on MojoAsyncResourceHandler (Closed)
Patch Set: rebase 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
« no previous file with comments | « no previous file | content/browser/loader/mojo_async_resource_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/mojo_async_resource_handler.h
diff --git a/content/browser/loader/mojo_async_resource_handler.h b/content/browser/loader/mojo_async_resource_handler.h
index 9edd9db10f9499b318448b24564ec34cf1e79250..ae47419a9565684db5a487f06858ed51221d318c 100644
--- a/content/browser/loader/mojo_async_resource_handler.h
+++ b/content/browser/loader/mojo_async_resource_handler.h
@@ -33,9 +33,7 @@ struct ResourceResponse;
// load events from the resource dispatcher host. This class is used only
// when LoadingWithMojo runtime flag is enabled.
//
-// TODO(yhirano): Implement redirects.
// TODO(yhirano): Add histograms.
-// TODO(yhirano): Set zoom level.
// TODO(yhirano): Send cached metadata.
//
// This class can be inherited only for tests.
@@ -67,7 +65,7 @@ class CONTENT_EXPORT MojoAsyncResourceHandler
// mojom::URLLoader implementation
void FollowRedirect() override;
- void ResumeForTesting();
+ void OnWritableForTesting();
static void SetAllocationSizeForTesting(size_t size);
static constexpr size_t kDefaultAllocationSize = 512 * 1024;
@@ -89,11 +87,11 @@ class CONTENT_EXPORT MojoAsyncResourceHandler
bool AllocateWriterIOBuffer(scoped_refptr<net::IOBufferWithSize>* buf,
bool* defer);
- void Resume();
- void OnDefer();
bool CheckForSufficientResource();
void OnWritable(MojoResult result);
void Cancel();
+ // This function can be overriden only for tests.
+ virtual void ReportBadMessage(const std::string& error);
ResourceDispatcherHostImpl* rdh_;
mojo::AssociatedBinding<mojom::URLLoader> binding_;
@@ -101,7 +99,8 @@ class CONTENT_EXPORT MojoAsyncResourceHandler
bool has_checked_for_sufficient_resources_ = false;
bool sent_received_response_message_ = false;
bool is_using_io_buffer_not_from_writer_ = false;
- bool did_defer_ = false;
+ bool did_defer_on_writing_ = false;
+ bool did_defer_on_redirect_ = false;
base::TimeTicks response_started_ticks_;
int64_t reported_total_received_bytes_ = 0;
« no previous file with comments | « no previous file | content/browser/loader/mojo_async_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698