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

Unified Diff: webkit/glue/plugins/pepper_url_request_info.cc

Issue 3053009: Pepper stream-to-file plumbing.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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 | « webkit/glue/plugins/pepper_url_request_info.h ('k') | webkit/glue/plugins/pepper_url_response_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/pepper_url_request_info.cc
===================================================================
--- webkit/glue/plugins/pepper_url_request_info.cc (revision 53197)
+++ webkit/glue/plugins/pepper_url_request_info.cc (working copy)
@@ -122,7 +122,8 @@
} // namespace
URLRequestInfo::URLRequestInfo(PluginModule* module)
- : Resource(module) {
+ : Resource(module),
+ stream_to_file_(false) {
}
URLRequestInfo::~URLRequestInfo() {
@@ -135,8 +136,14 @@
bool URLRequestInfo::SetBooleanProperty(PP_URLRequestProperty property,
bool value) {
- NOTIMPLEMENTED(); // TODO(darin): Implement me!
- return false;
+ switch (property) {
+ case PP_URLREQUESTPROPERTY_STREAMTOFILE:
+ stream_to_file_ = value;
+ return true;
+ default:
+ NOTIMPLEMENTED(); // TODO(darin): Implement me!
+ return false;
+ }
}
bool URLRequestInfo::SetStringProperty(PP_URLRequestProperty property,
@@ -167,6 +174,14 @@
int64_t start_offset,
int64_t number_of_bytes,
PP_Time expected_last_modified_time) {
+ // Ignore a call to append nothing.
+ if (number_of_bytes == 0)
+ return true;
+
+ // Check for bad values. (-1 means read until end of file.)
+ if (start_offset < 0 || number_of_bytes < -1)
+ return false;
+
body_.push_back(BodyItem(file_ref,
start_offset,
number_of_bytes,
@@ -178,6 +193,7 @@
WebURLRequest web_request;
web_request.initialize();
web_request.setURL(frame->document().completeURL(WebString::fromUTF8(url_)));
+ web_request.setDownloadToFile(stream_to_file_);
if (!method_.empty())
web_request.setHTTPMethod(WebString::fromUTF8(method_));
« no previous file with comments | « webkit/glue/plugins/pepper_url_request_info.h ('k') | webkit/glue/plugins/pepper_url_response_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698