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

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

Issue 307173002: Remove PlatformFile from components/nacl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update NexeFdCallback definition 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 | « components/nacl/renderer/file_downloader.h ('k') | components/nacl/renderer/nexe_load_manager.h » ('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 54c426d44bfa6ee9d270f721e1be6b443773d422..d6dd27063378f4b257215066747da1d023d9ca76 100644
--- a/components/nacl/renderer/file_downloader.cc
+++ b/components/nacl/renderer/file_downloader.cc
@@ -5,7 +5,6 @@
#include "components/nacl/renderer/file_downloader.h"
#include "base/callback.h"
-#include "base/platform_file.h"
#include "components/nacl/renderer/nexe_load_manager.h"
#include "net/base/net_errors.h"
#include "third_party/WebKit/public/platform/WebURLError.h"
@@ -15,11 +14,11 @@
namespace nacl {
FileDownloader::FileDownloader(scoped_ptr<blink::WebURLLoader> url_loader,
- base::PlatformFile file,
+ base::File file,
StatusCallback status_cb,
ProgressCallback progress_cb)
: url_loader_(url_loader.Pass()),
- file_(file),
+ file_(file.Pass()),
status_cb_(status_cb),
progress_cb_(progress_cb),
http_status_code_(-1),
@@ -55,8 +54,7 @@ void FileDownloader::didReceiveData(
int data_length,
int encoded_data_length) {
if (status_ == SUCCESS) {
- if (base::WritePlatformFile(file_, total_bytes_received_, data,
- data_length) == -1) {
+ if (file_.Write(total_bytes_received_, data, data_length) == -1) {
status_ = FAILED;
return;
}
@@ -73,10 +71,10 @@ void FileDownloader::didFinishLoading(
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)
+ if (file_.Seek(base::File::FROM_BEGIN, 0) != 0)
status_ = FAILED;
}
- status_cb_.Run(status_, http_status_code_);
+ status_cb_.Run(status_, file_.Pass(), http_status_code_);
delete this;
}
« no previous file with comments | « components/nacl/renderer/file_downloader.h ('k') | components/nacl/renderer/nexe_load_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698