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

Unified Diff: content/browser/renderer_host/resource_dispatcher_host_impl.cc

Issue 10878082: net: Move file operation code from UploadData to UploadDataStream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 8 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/renderer_host/resource_dispatcher_host_impl.cc
diff --git a/content/browser/renderer_host/resource_dispatcher_host_impl.cc b/content/browser/renderer_host/resource_dispatcher_host_impl.cc
index 205993824612efaa6fe85cfdb8091d4e62305292..bf78554b7db0f3f491820875e6982a2ee5b4fa00 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_impl.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_impl.cc
@@ -69,7 +69,7 @@
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "net/base/request_priority.h"
#include "net/base/ssl_cert_request_info.h"
-#include "net/base/upload_data.h"
+#include "net/base/upload_data_stream.h"
#include "net/cookies/cookie_monster.h"
#include "net/http/http_cache.h"
#include "net/http/http_response_headers.h"
@@ -965,7 +965,9 @@ void ResourceDispatcherHostImpl::BeginRequest(
GetBlobStorageControllerForResourceContext(resource_context)));
// This results in performing file IO. crbug.com/112607.
base::ThreadRestrictions::ScopedAllowIO allow_io;
- upload_size = request->get_upload_mutable()->GetContentLengthSync();
+ net::UploadDataStream upload_stream(request->get_upload_mutable());
+ if (upload_stream.Init() == net::OK)
+ upload_size = upload_stream.size();
}
bool allow_download = request_data.allow_download &&

Powered by Google App Engine
This is Rietveld 408576698