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

Unified Diff: components/nacl/renderer/file_downloader.cc

Issue 294633003: Pepper: Move StreamAsFile out of trusted plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes for bbudge Created 6 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 | « no previous file | components/nacl/renderer/ppb_nacl_private_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/renderer/file_downloader.cc
diff --git a/components/nacl/renderer/file_downloader.cc b/components/nacl/renderer/file_downloader.cc
index ac7e73211732474a05a91a2c773b8c69b077ba0e..54c426d44bfa6ee9d270f721e1be6b443773d422 100644
--- a/components/nacl/renderer/file_downloader.cc
+++ b/components/nacl/renderer/file_downloader.cc
@@ -70,6 +70,12 @@ void FileDownloader::didFinishLoading(
blink::WebURLLoader* loader,
double finish_time,
int64_t total_encoded_data_length) {
+ if (status_ == SUCCESS) {
+ // Seek back to the beginning of the file that was just written so it's
+ // easy for consumers to use.
+ if (base::SeekPlatformFile(file_, base::PLATFORM_FILE_FROM_BEGIN, 0) != 0)
+ status_ = FAILED;
+ }
status_cb_.Run(status_, http_status_code_);
delete this;
}
« no previous file with comments | « no previous file | components/nacl/renderer/ppb_nacl_private_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698