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

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

Issue 10834289: Split net::UploadData into two: for IPC and for upload handling (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
« no previous file with comments | « no previous file | content/common/resource_dispatcher.cc » ('j') | webkit/glue/webupload_data.h » ('J')
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 052e5ce9d52d6a8249849bdb17ec96617a296e13..511c70e11652fd11e38b5be9c6d7c02c3b958e40 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_impl.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_impl.cc
@@ -83,6 +83,7 @@
#include "webkit/blob/blob_storage_controller.h"
#include "webkit/blob/shareable_file_reference.h"
#include "webkit/glue/webkit_glue.h"
+#include "webkit/glue/webupload_data.h"
using base::Time;
using base::TimeDelta;
@@ -172,11 +173,11 @@ bool ShouldServiceRequest(ProcessType process_type,
// Check if the renderer is permitted to upload the requested files.
if (request_data.upload_data) {
- const std::vector<net::UploadData::Element>* uploads =
+ const std::vector<WebUploadData::Element>* uploads =
request_data.upload_data->elements();
- std::vector<net::UploadData::Element>::const_iterator iter;
+ std::vector<WebUploadData::Element>::const_iterator iter;
for (iter = uploads->begin(); iter != uploads->end(); ++iter) {
- if (iter->type() == net::UploadData::TYPE_FILE &&
+ if (iter->type() == WebUploadData::TYPE_FILE &&
!policy->CanReadFile(child_id, iter->file_path())) {
NOTREACHED() << "Denied unauthorized upload of "
<< iter->file_path().value();
@@ -964,10 +965,12 @@ void ResourceDispatcherHostImpl::BeginRequest(
// Set upload data.
uint64 upload_size = 0;
if (request_data.upload_data) {
- request->set_upload(request_data.upload_data);
+ scoped_refptr<net::UploadData> upload = new net::UploadData;
+ request_data.upload_data->PopulateUploadData(upload.get());
+ request->set_upload(upload);
// This results in performing file IO. crbug.com/112607.
base::ThreadRestrictions::ScopedAllowIO allow_io;
- upload_size = request_data.upload_data->GetContentLengthSync();
+ upload_size = upload->GetContentLengthSync();
}
bool allow_download = request_data.allow_download &&
« no previous file with comments | « no previous file | content/common/resource_dispatcher.cc » ('j') | webkit/glue/webupload_data.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698