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

Unified Diff: ppapi/native_client/src/trusted/plugin/file_downloader.cc

Issue 293403008: Pepper: FileDownloader cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased 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
Index: ppapi/native_client/src/trusted/plugin/file_downloader.cc
diff --git a/ppapi/native_client/src/trusted/plugin/file_downloader.cc b/ppapi/native_client/src/trusted/plugin/file_downloader.cc
index 7c6c045a5af13f42ed2db46a1778e2d7372cb689..68074733fabeb92620b1c1a8c1030839ea26e6b3 100644
--- a/ppapi/native_client/src/trusted/plugin/file_downloader.cc
+++ b/ppapi/native_client/src/trusted/plugin/file_downloader.cc
@@ -20,12 +20,12 @@
namespace plugin {
-void FileDownloader::Initialize(Plugin* instance) {
- PLUGIN_PRINTF(("FileDownloader::FileDownloader (this=%p)\n",
- static_cast<void*>(this)));
- CHECK(instance != NULL);
- CHECK(instance_ == NULL); // Can only initialize once.
- instance_ = instance;
+FileDownloader::FileDownloader(Plugin* instance)
+ : instance_(instance),
dmichael (off chromium) 2014/05/28 20:20:19 nit: indentation looks off
+ file_open_notify_callback_(pp::BlockUntilComplete()),
+ stream_finish_callback_(pp::BlockUntilComplete()),
+ mode_(DOWNLOAD_NONE),
+ data_stream_callback_source_(NULL) {
callback_factory_.Initialize(this);
temp_buffer_.resize(kTempBufferSize);
}
@@ -40,7 +40,6 @@ bool FileDownloader::OpenStream(
return false;
status_code_ = -1;
- url_ = url;
file_open_notify_callback_ = callback;
mode_ = DOWNLOAD_TO_BUFFER_AND_STREAM;
pp::URLRequestInfo url_request(instance_);
@@ -63,7 +62,7 @@ bool FileDownloader::OpenStream(
url_request.SetRecordDownloadProgress(true);
// Prepare the url request.
- url_request.SetURL(url_);
+ url_request.SetURL(url);
// Request asynchronous download of the url providing an on-load callback.
// As long as this step is guaranteed to be asynchronous, we can call
@@ -117,7 +116,7 @@ void FileDownloader::URLLoadStartNotify(int32_t pp_error) {
file_open_notify_callback_.RunAndClear(PP_OK);
}
-void FileDownloader::FinishStreaming(
+void FileDownloader::BeginStreaming(
const pp::CompletionCallback& callback) {
stream_finish_callback_ = callback;

Powered by Google App Engine
This is Rietveld 408576698