diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-25 19:55:08 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-25 19:55:08 +0000 |
commit | ccf1ac4398aeb300bc3c005640aaf57500488e2d (patch) | |
tree | 35eadc64a003ec79f2fc77924f5b92928cede2d0 /chrome/browser/renderer_host/resource_dispatcher_host.cc | |
parent | 059292e77d7fcfbf930ccb8cafdaaadd7a505a2e (diff) | |
download | chromium_src-ccf1ac4398aeb300bc3c005640aaf57500488e2d.zip chromium_src-ccf1ac4398aeb300bc3c005640aaf57500488e2d.tar.gz chromium_src-ccf1ac4398aeb300bc3c005640aaf57500488e2d.tar.bz2 |
Chrome changes to support cached form submissions.
The solution is to add a user-defined identifier to UploadData.
If that identifier is set, and if the request method is POST,
then HttpCache will enable caching for the response. (The cache
key will be a composition of the identifier and the URL.) A
subsequent POST request to the same URL with the same identifier
will "hit" the previously generated cache entry. Reuse from the
cache is subject to all of the standard rules.
For reference, here are the corresponding net changes:
http://codereview.chromium.org/52028
Here are the corresponding WebKit changes:
http://trac.webkit.org/changeset/41919
BUG=2636
R=sky
Review URL: http://codereview.chromium.org/52040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12485 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/resource_dispatcher_host.cc')
-rw-r--r-- | chrome/browser/renderer_host/resource_dispatcher_host.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc index e8e8d3b..9d4f7bd 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc @@ -116,14 +116,16 @@ bool ShouldServiceRequest(ChildProcessInfo::ProcessType process_type, } // Check if the renderer is permitted to upload the requested files. - const std::vector<net::UploadData::Element>& uploads = - request_data.upload_content; - std::vector<net::UploadData::Element>::const_iterator iter; - for (iter = uploads.begin(); iter != uploads.end(); ++iter) { - if (iter->type() == net::UploadData::TYPE_FILE && - !policy->CanUploadFile(process_id, iter->file_path())) { - NOTREACHED() << "Denied unauthorized upload of " << iter->file_path(); - return false; + if (request_data.upload_data) { + const std::vector<net::UploadData::Element>& uploads = + request_data.upload_data->elements(); + std::vector<net::UploadData::Element>::const_iterator iter; + for (iter = uploads.begin(); iter != uploads.end(); ++iter) { + if (iter->type() == net::UploadData::TYPE_FILE && + !policy->CanUploadFile(process_id, iter->file_path())) { + NOTREACHED() << "Denied unauthorized upload of " << iter->file_path(); + return false; + } } } @@ -330,11 +332,9 @@ void ResourceDispatcherHost::BeginRequest( // Set upload data. uint64 upload_size = 0; - if (!request_data.upload_content.empty()) { - scoped_refptr<net::UploadData> upload = new net::UploadData(); - upload->set_elements(request_data.upload_content); // Deep copy. - request->set_upload(upload); - upload_size = upload->GetContentLength(); + if (request_data.upload_data) { + request->set_upload(request_data.upload_data); + upload_size = request_data.upload_data->GetContentLength(); } // Install a CrossSiteResourceHandler if this request is coming from a |