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

Side by Side Diff: net/base/file_stream.h

Issue 1158923005: Use the exact-width integer types defined in <stdint.h> rather than (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak comments. Exclude mime_sniffer*. Rebase. Created 5 years, 6 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 unified diff | Download patch
OLDNEW
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 // 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_
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 // Returns true if Open succeeded and Close has not been called. 62 // Returns true if Open succeeded and Close has not been called.
63 virtual bool IsOpen() const; 63 virtual bool IsOpen() const;
64 64
65 // Adjust the position from where data is read asynchronously. 65 // Adjust the position from where data is read asynchronously.
66 // Upon success, ERR_IO_PENDING is returned and |callback| will be run 66 // Upon success, ERR_IO_PENDING is returned and |callback| will be run
67 // on the thread where Seek() was called with the the stream position 67 // on the thread where Seek() was called with the the stream position
68 // relative to the start of the file. Otherwise, an error code is returned. 68 // relative to the start of the file. Otherwise, an error code is returned.
69 // It is invalid to request any asynchronous operations while there is an 69 // It is invalid to request any asynchronous operations while there is an
70 // in-flight asynchronous operation. 70 // in-flight asynchronous operation.
71 virtual int Seek(base::File::Whence whence, int64 offset, 71 virtual int Seek(base::File::Whence whence,
72 int64_t offset,
72 const Int64CompletionCallback& callback); 73 const Int64CompletionCallback& callback);
73 74
74 // Call this method to read data from the current stream position 75 // Call this method to read data from the current stream position
75 // asynchronously. Up to buf_len bytes will be copied into buf. (In 76 // asynchronously. Up to buf_len bytes will be copied into buf. (In
76 // other words, partial reads are allowed.) Returns the number of bytes 77 // other words, partial reads are allowed.) Returns the number of bytes
77 // copied, 0 if at end-of-file, or an error code if the operation could 78 // copied, 0 if at end-of-file, or an error code if the operation could
78 // not be performed. 79 // not be performed.
79 // 80 //
80 // The file must be opened with FLAG_ASYNC, and a non-null 81 // The file must be opened with FLAG_ASYNC, and a non-null
81 // callback must be passed to this method. If the read could not 82 // callback must be passed to this method. If the read could not
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // without explicitly calling Close, the file should be closed asynchronously 153 // without explicitly calling Close, the file should be closed asynchronously
153 // without delaying FileStream's destructor. 154 // without delaying FileStream's destructor.
154 scoped_ptr<Context> context_; 155 scoped_ptr<Context> context_;
155 156
156 DISALLOW_COPY_AND_ASSIGN(FileStream); 157 DISALLOW_COPY_AND_ASSIGN(FileStream);
157 }; 158 };
158 159
159 } // namespace net 160 } // namespace net
160 161
161 #endif // NET_BASE_FILE_STREAM_H_ 162 #endif // NET_BASE_FILE_STREAM_H_
OLDNEW
« no previous file with comments | « net/base/escape.cc ('k') | net/base/file_stream.cc » ('j') | net/cert/crl_set_storage.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698