| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 // This file defines FileStream, a basic interface for reading and writing files | 5 // This file defines FileStream, a basic interface for reading and writing files |
| 6 // synchronously or asynchronously with support for seeking to an offset. | 6 // synchronously or asynchronously with support for seeking to an offset. |
| 7 // Note that even when used asynchronously, only one operation is supported at | 7 // Note that even when used asynchronously, only one operation is supported at |
| 8 // a time. | 8 // a time. |
| 9 | 9 |
| 10 #ifndef NET_BASE_FILE_STREAM_H_ | 10 #ifndef NET_BASE_FILE_STREAM_H_ |
| 11 #define NET_BASE_FILE_STREAM_H_ | 11 #define NET_BASE_FILE_STREAM_H_ |
| 12 | 12 |
| 13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "base/platform_file.h" | 14 #include "base/platform_file.h" |
| 15 #include "base/scoped_ptr.h" |
| 15 #include "net/base/completion_callback.h" | 16 #include "net/base/completion_callback.h" |
| 16 | 17 |
| 17 namespace net { | 18 namespace net { |
| 18 | 19 |
| 19 // TODO(darin): Move this to a more generic location. | 20 // TODO(darin): Move this to a more generic location. |
| 20 // This explicit mapping matches both FILE_ on Windows and SEEK_ on Linux. | 21 // This explicit mapping matches both FILE_ on Windows and SEEK_ on Linux. |
| 21 enum Whence { | 22 enum Whence { |
| 22 FROM_BEGIN = 0, | 23 FROM_BEGIN = 0, |
| 23 FROM_CURRENT = 1, | 24 FROM_CURRENT = 1, |
| 24 FROM_END = 2 | 25 FROM_END = 2 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 127 |
| 127 base::PlatformFile file_; | 128 base::PlatformFile file_; |
| 128 int open_flags_; | 129 int open_flags_; |
| 129 | 130 |
| 130 DISALLOW_COPY_AND_ASSIGN(FileStream); | 131 DISALLOW_COPY_AND_ASSIGN(FileStream); |
| 131 }; | 132 }; |
| 132 | 133 |
| 133 } // namespace net | 134 } // namespace net |
| 134 | 135 |
| 135 #endif // NET_BASE_FILE_STREAM_H_ | 136 #endif // NET_BASE_FILE_STREAM_H_ |
| OLD | NEW |