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

Unified Diff: content/child/npapi/plugin_url_fetcher.cc

Issue 1103813002: Make WebURLLoader capable of retaining received buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « content/child/npapi/plugin_url_fetcher.h ('k') | content/child/resource_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/npapi/plugin_url_fetcher.cc
diff --git a/content/child/npapi/plugin_url_fetcher.cc b/content/child/npapi/plugin_url_fetcher.cc
index b4ef6772913b62c5b59820ecf47ad3f4916d47ad..c8a93ca3a2115624676067a510c3d3afc0c019e8 100644
--- a/content/child/npapi/plugin_url_fetcher.cc
+++ b/content/child/npapi/plugin_url_fetcher.cc
@@ -327,14 +327,16 @@ void PluginURLFetcher::OnDownloadedData(int len,
int encoded_data_length) {
}
-void PluginURLFetcher::OnReceivedData(const char* data,
- int data_length,
- int encoded_data_length) {
+void PluginURLFetcher::OnReceivedData(scoped_ptr<ReceivedData> data) {
+ const char* payload = data->payload();
+ int data_length = data->length();
+ int encoded_data_length = data->encoded_length();
if (!plugin_stream_)
return;
if (multipart_delegate_) {
- multipart_delegate_->OnReceivedData(data, data_length, encoded_data_length);
+ multipart_delegate_->OnReceivedData(payload, data_length,
+ encoded_data_length);
} else {
int64 offset = data_offset_;
data_offset_ += data_length;
@@ -344,10 +346,10 @@ void PluginURLFetcher::OnReceivedData(const char* data,
// ResourceDispatcher it's not mapped for write access in this process.
// http://crbug.com/308466.
scoped_ptr<char[]> data_copy(new char[data_length]);
- memcpy(data_copy.get(), data, data_length);
+ memcpy(data_copy.get(), payload, data_length);
plugin_stream_->DidReceiveData(data_copy.get(), data_length, offset);
} else {
- plugin_stream_->DidReceiveData(data, data_length, offset);
+ plugin_stream_->DidReceiveData(payload, data_length, offset);
}
// DANGER: this instance may be deleted at this point.
}
« no previous file with comments | « content/child/npapi/plugin_url_fetcher.h ('k') | content/child/resource_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698