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

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

Issue 2612903008: Add UploadProgressTracker unittest (Closed)
Patch Set: Created 3 years, 11 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 fb69ec7bc1e59a02d8b1dc2ac617b47cdfceebb1..a99f1af7254e8a5b876ae2979db4da7b84eba825 100644
--- a/content/browser/loader/async_resource_handler.h
+++ b/content/browser/loader/async_resource_handler.h
@@ -14,6 +14,7 @@
#include "base/memory/ref_counted.h"
#include "content/browser/loader/resource_handler.h"
#include "content/browser/loader/resource_message_delegate.h"
+#include "content/browser/loader/upload_progress_tracker.h"
#include "content/common/content_export.h"
#include "net/base/io_buffer.h"
#include "url/gurl.h"
@@ -25,12 +26,13 @@ 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.
-class CONTENT_EXPORT AsyncResourceHandler : public ResourceHandler,
- public ResourceMessageDelegate {
+class CONTENT_EXPORT AsyncResourceHandler
+ : public ResourceHandler,
+ public ResourceMessageDelegate,
+ public UploadProgressTracker::Client {
public:
AsyncResourceHandler(net::URLRequest* request,
ResourceDispatcherHostImpl* rdh);
@@ -52,6 +54,11 @@ class CONTENT_EXPORT AsyncResourceHandler : public ResourceHandler,
bool* defer) override;
void OnDataDownloaded(int bytes_downloaded) override;
+ // UploadProgressTracker::Client implementation:
+ net::UploadProgress GetUploadProgress() override;
+ void ReportUploadProgress(int64_t current_position,
+ int64_t total_size) override;
+
private:
class InliningHelper;
@@ -67,7 +74,6 @@ 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_;

Powered by Google App Engine
This is Rietveld 408576698