| Index: net/base/upload_file_element_reader.h
|
| diff --git a/net/base/upload_file_element_reader.h b/net/base/upload_file_element_reader.h
|
| index f85d45f756af1ea3aa3027898c7b119cdef4c8e5..dec2115115e079150e8dd15ab6fafce5a2fb1637 100644
|
| --- a/net/base/upload_file_element_reader.h
|
| +++ b/net/base/upload_file_element_reader.h
|
| @@ -8,11 +8,16 @@
|
| #include "base/compiler_specific.h"
|
| #include "base/file_path.h"
|
| #include "base/gtest_prod_util.h"
|
| +#include "base/memory/ref_counted.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/time.h"
|
| #include "net/base/upload_element_reader.h"
|
|
|
| +namespace base {
|
| +class TaskRunner;
|
| +}
|
| +
|
| namespace net {
|
|
|
| class FileStream;
|
| @@ -21,15 +26,22 @@ class FileStream;
|
| class NET_EXPORT UploadFileElementReader : public UploadElementReader {
|
| public:
|
| // Deletes FileStream on the worker pool to avoid blocking the IO thread.
|
| - // This class is used as a template argument of scoped_ptr_malloc.
|
| + // This class is used as a template argument of scoped_ptr.
|
| class FileStreamDeleter {
|
| public:
|
| + explicit FileStreamDeleter(base::TaskRunner* task_runner);
|
| + ~FileStreamDeleter();
|
| void operator() (FileStream* file_stream) const;
|
| +
|
| + private:
|
| + scoped_refptr<base::TaskRunner> task_runner_;
|
| };
|
|
|
| - typedef scoped_ptr_malloc<FileStream, FileStreamDeleter> ScopedFileStreamPtr;
|
| + typedef scoped_ptr<FileStream, FileStreamDeleter> ScopedFileStreamPtr;
|
|
|
| - UploadFileElementReader(const FilePath& path,
|
| + // |task_runner| is used to perform file operations. It must not be NULL.
|
| + UploadFileElementReader(base::TaskRunner* task_runner,
|
| + const FilePath& path,
|
| uint64 range_offset,
|
| uint64 range_length,
|
| const base::Time& expected_modification_time);
|
| @@ -81,6 +93,7 @@ class NET_EXPORT UploadFileElementReader : public UploadElementReader {
|
| ~ScopedOverridingContentLengthForTests();
|
| };
|
|
|
| + scoped_refptr<base::TaskRunner> task_runner_;
|
| const FilePath path_;
|
| const uint64 range_offset_;
|
| const uint64 range_length_;
|
|
|