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

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

Issue 1301103002: moved upload progress logic from ResourceLoader to AsyncResourceHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: single quotes, nits, and return success on success Created 5 years, 4 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/async_resource_handler.h
diff --git a/content/browser/loader/async_resource_handler.h b/content/browser/loader/async_resource_handler.h
index fb4086db4eecf17f6ffa52f26f972dcd0b262bb3..464be2fa06934ed78f030db5405c1a77bcb846a0 100644
--- a/content/browser/loader/async_resource_handler.h
+++ b/content/browser/loader/async_resource_handler.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/memory/ref_counted.h"
+#include "base/timer/timer.h"
#include "content/browser/loader/resource_handler.h"
#include "content/browser/loader/resource_message_delegate.h"
#include "url/gurl.h"
@@ -35,7 +36,6 @@ class AsyncResourceHandler : public ResourceHandler,
bool OnMessageReceived(const IPC::Message& message) override;
// ResourceHandler implementation:
- bool OnUploadProgress(uint64 position, uint64 size) override;
bool OnRequestRedirected(const net::RedirectInfo& redirect_info,
ResourceResponse* response,
bool* defer) override;
@@ -55,6 +55,9 @@ class AsyncResourceHandler : public ResourceHandler,
// IPC message handlers:
void OnFollowRedirect(int request_id);
void OnDataReceivedACK(int request_id);
+ void OnUploadProgressACK(int request_id);
+
+ void ReportUploadProgress();
bool EnsureResourceBufferIsInitialized();
void ResumeIfDeferred();
@@ -75,6 +78,11 @@ class AsyncResourceHandler : public ResourceHandler,
bool sent_received_response_msg_;
bool sent_first_data_msg_;
+ uint64 last_upload_position_;
+ bool waiting_for_upload_progress_ack_;
+ base::TimeTicks last_upload_ticks_;
+ base::RepeatingTimer<AsyncResourceHandler> progress_timer_;
+
int64_t reported_transfer_size_;
DISALLOW_COPY_AND_ASSIGN(AsyncResourceHandler);
« no previous file with comments | « content/browser/download/save_file_resource_handler.cc ('k') | content/browser/loader/async_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698