Index: content/browser/download/base_file.cc |
=================================================================== |
--- content/browser/download/base_file.cc (revision 142108) |
+++ content/browser/download/base_file.cc (working copy) |
@@ -4,6 +4,7 @@ |
#include "content/browser/download/base_file.h" |
+#include "base/bind.h" |
#include "base/file_util.h" |
#include "base/format_macros.h" |
#include "base/logging.h" |
@@ -71,8 +72,7 @@ |
bound_net_log.AddEvent( |
net::NetLog::TYPE_DOWNLOAD_FILE_ERROR, |
- make_scoped_refptr( |
- new download_net_logs::FileErrorParameters(operation, net_error))); |
+ base::Bind(&download_net_logs::FileErrorCallback, operation, net_error)); |
return net_error; |
} |
@@ -325,9 +325,8 @@ |
bound_net_log_.AddEvent( |
net::NetLog::TYPE_DOWNLOAD_FILE_RENAMED, |
- make_scoped_refptr( |
- new download_net_logs::FileRenamedParameters( |
- full_path_.AsUTF8Unsafe(), new_path.AsUTF8Unsafe()))); |
+ base::Bind(&download_net_logs::FileRenamedCallback, |
+ &full_path_, &new_path)); |
// If the new path is same as the old one, there is no need to perform the |
// following renaming logic. |
@@ -396,19 +395,19 @@ |
void BaseFile::Detach() { |
detached_ = true; |
- bound_net_log_.AddEvent(net::NetLog::TYPE_DOWNLOAD_FILE_DETACHED, NULL); |
+ bound_net_log_.AddEvent(net::NetLog::TYPE_DOWNLOAD_FILE_DETACHED); |
} |
void BaseFile::Cancel() { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
DCHECK(!detached_); |
- bound_net_log_.AddEvent(net::NetLog::TYPE_CANCELLED, NULL); |
+ bound_net_log_.AddEvent(net::NetLog::TYPE_CANCELLED); |
Close(); |
if (!full_path_.empty()) { |
- bound_net_log_.AddEvent(net::NetLog::TYPE_DOWNLOAD_FILE_DELETED, NULL); |
+ bound_net_log_.AddEvent(net::NetLog::TYPE_DOWNLOAD_FILE_DELETED); |
file_util::Delete(full_path_, false); |
} |
@@ -486,9 +485,8 @@ |
bound_net_log_.BeginEvent( |
net::NetLog::TYPE_DOWNLOAD_FILE_OPENED, |
- make_scoped_refptr( |
- new download_net_logs::FileOpenedParameters( |
- full_path_.AsUTF8Unsafe(), bytes_so_far_))); |
+ base::Bind(&download_net_logs::FileOpenedCallback, |
+ &full_path_, bytes_so_far_)); |
// Create a new file stream if it is not provided. |
if (!file_stream_.get()) { |
@@ -519,7 +517,7 @@ |
void BaseFile::Close() { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
- bound_net_log_.AddEvent(net::NetLog::TYPE_DOWNLOAD_FILE_CLOSED, NULL); |
+ bound_net_log_.AddEvent(net::NetLog::TYPE_DOWNLOAD_FILE_CLOSED); |
if (file_stream_.get()) { |
#if defined(OS_CHROMEOS) |
@@ -536,7 +534,7 @@ |
// This should only be called when we have a stream. |
DCHECK(file_stream_.get() != NULL); |
file_stream_.reset(); |
- bound_net_log_.EndEvent(net::NetLog::TYPE_DOWNLOAD_FILE_OPENED, NULL); |
+ bound_net_log_.EndEvent(net::NetLog::TYPE_DOWNLOAD_FILE_OPENED); |
return net_error; |
} |