| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef STORAGE_BROWSER_FILEAPI_LOCAL_FILE_STREAM_WRITER_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_LOCAL_FILE_STREAM_WRITER_H_ |
| 6 #define STORAGE_BROWSER_FILEAPI_LOCAL_FILE_STREAM_WRITER_H_ | 6 #define STORAGE_BROWSER_FILEAPI_LOCAL_FILE_STREAM_WRITER_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 namespace storage { | 28 namespace storage { |
| 29 | 29 |
| 30 // This class is a thin wrapper around net::FileStream for writing local files. | 30 // This class is a thin wrapper around net::FileStream for writing local files. |
| 31 class STORAGE_EXPORT LocalFileStreamWriter | 31 class STORAGE_EXPORT LocalFileStreamWriter |
| 32 : public NON_EXPORTED_BASE(FileStreamWriter) { | 32 : public NON_EXPORTED_BASE(FileStreamWriter) { |
| 33 public: | 33 public: |
| 34 virtual ~LocalFileStreamWriter(); | 34 virtual ~LocalFileStreamWriter(); |
| 35 | 35 |
| 36 // FileStreamWriter overrides. | 36 // FileStreamWriter overrides. |
| 37 virtual int Write(net::IOBuffer* buf, int buf_len, | 37 virtual int Write(net::IOBuffer* buf, int buf_len, |
| 38 const net::CompletionCallback& callback) OVERRIDE; | 38 const net::CompletionCallback& callback) override; |
| 39 virtual int Cancel(const net::CompletionCallback& callback) OVERRIDE; | 39 virtual int Cancel(const net::CompletionCallback& callback) override; |
| 40 virtual int Flush(const net::CompletionCallback& callback) OVERRIDE; | 40 virtual int Flush(const net::CompletionCallback& callback) override; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 friend class content::LocalFileStreamWriterTest; | 43 friend class content::LocalFileStreamWriterTest; |
| 44 friend class FileStreamWriter; | 44 friend class FileStreamWriter; |
| 45 LocalFileStreamWriter(base::TaskRunner* task_runner, | 45 LocalFileStreamWriter(base::TaskRunner* task_runner, |
| 46 const base::FilePath& file_path, | 46 const base::FilePath& file_path, |
| 47 int64 initial_offset, | 47 int64 initial_offset, |
| 48 OpenOrCreate open_or_create); | 48 OpenOrCreate open_or_create); |
| 49 | 49 |
| 50 // Opens |file_path_| and if it succeeds, proceeds to InitiateSeek(). | 50 // Opens |file_path_| and if it succeeds, proceeds to InitiateSeek(). |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 scoped_ptr<net::FileStream> stream_impl_; | 91 scoped_ptr<net::FileStream> stream_impl_; |
| 92 net::CompletionCallback cancel_callback_; | 92 net::CompletionCallback cancel_callback_; |
| 93 | 93 |
| 94 base::WeakPtrFactory<LocalFileStreamWriter> weak_factory_; | 94 base::WeakPtrFactory<LocalFileStreamWriter> weak_factory_; |
| 95 DISALLOW_COPY_AND_ASSIGN(LocalFileStreamWriter); | 95 DISALLOW_COPY_AND_ASSIGN(LocalFileStreamWriter); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace storage | 98 } // namespace storage |
| 99 | 99 |
| 100 #endif // STORAGE_BROWSER_FILEAPI_LOCAL_FILE_STREAM_WRITER_H_ | 100 #endif // STORAGE_BROWSER_FILEAPI_LOCAL_FILE_STREAM_WRITER_H_ |
| OLD | NEW |