summaryrefslogtreecommitdiffstats
path: root/webkit/glue/weburlloader_impl.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-22 20:52:49 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-22 20:52:49 +0000
commitbb55162dcf0c1100e27b1088125e3ad5175a6621 (patch)
treeb3b5049237b3f5889c6a681cc4104beff8003de6 /webkit/glue/weburlloader_impl.cc
parentad5de0edcc8f43260e23c8dc0e300133072b5c68 (diff)
downloadchromium_src-bb55162dcf0c1100e27b1088125e3ad5175a6621.zip
chromium_src-bb55162dcf0c1100e27b1088125e3ad5175a6621.tar.gz
chromium_src-bb55162dcf0c1100e27b1088125e3ad5175a6621.tar.bz2
Pepper stream-to-file plumbing.
This just hooks up the renderer side of the IPC. R=brettw BUG=49789 TEST=none Review URL: http://codereview.chromium.org/3053009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53378 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/weburlloader_impl.cc')
-rw-r--r--webkit/glue/weburlloader_impl.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc
index f235734..dcb05fa 100644
--- a/webkit/glue/weburlloader_impl.cc
+++ b/webkit/glue/weburlloader_impl.cc
@@ -182,6 +182,7 @@ void PopulateURLResponse(
response->setWasFetchedViaProxy(info.was_fetched_via_proxy);
response->setConnectionID(info.connection_id);
response->setConnectionReused(info.connection_reused);
+ response->setDownloadFilePath(FilePathToWebString(info.download_file_path));
WebURLLoadTiming timing;
timing.initialize();
@@ -213,7 +214,7 @@ void PopulateURLResponse(
// pass it to GetSuggestedFilename.
std::string value;
if (headers->EnumerateHeader(NULL, "content-disposition", &value)) {
- response->setSuggestedFileName(webkit_glue::FilePathToWebString(
+ response->setSuggestedFileName(FilePathToWebString(
net::GetSuggestedFilename(url, value, "", FilePath())));
}
@@ -260,6 +261,7 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>,
GURL* new_first_party_for_cookies);
virtual void OnReceivedResponse(
const ResourceLoaderBridge::ResponseInfo& info, bool content_filtered);
+ virtual void OnDownloadedData(int len);
virtual void OnReceivedData(const char* data, int len);
virtual void OnReceivedCachedMetadata(const char* data, int len);
virtual void OnCompletedRequest(
@@ -384,7 +386,7 @@ void WebURLLoaderImpl::Context::Start(
// TODO(brettw) this should take parameter encoding into account when
// creating the GURLs.
- webkit_glue::ResourceLoaderBridge::RequestInfo request_info;
+ ResourceLoaderBridge::RequestInfo request_info;
request_info.method = method;
request_info.url = url;
request_info.first_party_for_cookies = request.firstPartyForCookies();
@@ -397,6 +399,7 @@ void WebURLLoaderImpl::Context::Start(
request_info.request_type = FromTargetType(request.targetType());
request_info.appcache_host_id = request.appCacheHostID();
request_info.routing_id = request.requestorID();
+ request_info.download_to_file = request.downloadToFile();
bridge_.reset(ResourceLoaderBridge::Create(request_info));
if (!request.httpBody().isNull()) {
@@ -545,6 +548,11 @@ void WebURLLoaderImpl::Context::OnReceivedResponse(
response_url_ = response.url();
}
+void WebURLLoaderImpl::Context::OnDownloadedData(int len) {
+ if (client_)
+ client_->didDownloadData(loader_, len);
+}
+
void WebURLLoaderImpl::Context::OnReceivedData(const char* data, int len) {
if (!client_)
return;