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

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

Issue 2546653003: Factor out upload progress handling from AsyncResourceHandler (Closed)
Patch Set: . Created 4 years 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 | « content/browser/loader/DEPS ('k') | content/browser/loader/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/async_resource_handler.h
diff --git a/content/browser/loader/async_resource_handler.h b/content/browser/loader/async_resource_handler.h
index 1279d506be3529f17b4208d80e247f5f5e4d2023..fb69ec7bc1e59a02d8b1dc2ac617b47cdfceebb1 100644
--- a/content/browser/loader/async_resource_handler.h
+++ b/content/browser/loader/async_resource_handler.h
@@ -7,11 +7,11 @@
#include <stdint.h>
+#include <memory>
#include <string>
#include "base/macros.h"
#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 "content/common/content_export.h"
@@ -25,6 +25,7 @@ class URLRequest;
namespace content {
class ResourceBuffer;
class ResourceDispatcherHostImpl;
+class UploadProgressTracker;
// Used to complete an asynchronous resource request in response to resource
// load events from the resource dispatcher host.
@@ -59,8 +60,6 @@ class CONTENT_EXPORT AsyncResourceHandler : public ResourceHandler,
void OnDataReceivedACK(int request_id);
void OnUploadProgressACK(int request_id);
- void ReportUploadProgress();
-
bool EnsureResourceBufferIsInitialized();
void ResumeIfDeferred();
void OnDefer();
@@ -68,6 +67,7 @@ class CONTENT_EXPORT AsyncResourceHandler : public ResourceHandler,
int CalculateEncodedDataLengthToReport();
int CalculateEncodedBodyLengthToReport();
void RecordHistogram();
+ void SendUploadProgress(int64_t current_position, int64_t total_size);
scoped_refptr<ResourceBuffer> buffer_;
ResourceDispatcherHostImpl* rdh_;
@@ -89,10 +89,7 @@ class CONTENT_EXPORT AsyncResourceHandler : public ResourceHandler,
std::unique_ptr<InliningHelper> inlining_helper_;
base::TimeTicks response_started_ticks_;
- uint64_t last_upload_position_;
- bool waiting_for_upload_progress_ack_;
- base::TimeTicks last_upload_ticks_;
- base::RepeatingTimer progress_timer_;
+ std::unique_ptr<UploadProgressTracker> upload_progress_tracker_;
int64_t reported_transfer_size_;
« no previous file with comments | « content/browser/loader/DEPS ('k') | content/browser/loader/async_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698