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

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: Remove initialization check from IsInMemory 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
« no previous file with comments | « chrome_frame/urlmon_upload_data_stream.cc ('k') | net/base/upload_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
willchan no longer on Chromium 2012/08/28 23:45:22 I'm concerned about calling Init() here. Doesn't t
hashimoto 2012/08/28 23:49:56 You're right. Resetting offsets here is wrong. We
willchan no longer on Chromium 2012/08/28 23:59:36 I read everything else already. That was my only c
+ upload_size = upload_stream.size();
}
bool allow_download = request_data.allow_download &&
« no previous file with comments | « chrome_frame/urlmon_upload_data_stream.cc ('k') | net/base/upload_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698