| 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 // This file implements FileStream for POSIX. | 5 // This file implements FileStream for POSIX. |
| 6 | 6 |
| 7 #ifndef NET_BASE_FILE_STREAM_POSIX_H_ | 7 #ifndef NET_BASE_FILE_STREAM_POSIX_H_ |
| 8 #define NET_BASE_FILE_STREAM_POSIX_H_ | 8 #define NET_BASE_FILE_STREAM_POSIX_H_ |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 int Seek(Whence whence, int64 offset, | 41 int Seek(Whence whence, int64 offset, |
| 42 const Int64CompletionCallback& callback); | 42 const Int64CompletionCallback& callback); |
| 43 int64 SeekSync(Whence whence, int64 offset); | 43 int64 SeekSync(Whence whence, int64 offset); |
| 44 int64 Available(); | 44 int64 Available(); |
| 45 int Read(IOBuffer* buf, int buf_len, const CompletionCallback& callback); | 45 int Read(IOBuffer* buf, int buf_len, const CompletionCallback& callback); |
| 46 int ReadSync(char* buf, int buf_len); | 46 int ReadSync(char* buf, int buf_len); |
| 47 int ReadUntilComplete(char *buf, int buf_len); | 47 int ReadUntilComplete(char *buf, int buf_len); |
| 48 int Write(IOBuffer* buf, int buf_len, const CompletionCallback& callback); | 48 int Write(IOBuffer* buf, int buf_len, const CompletionCallback& callback); |
| 49 int WriteSync(const char* buf, int buf_len); | 49 int WriteSync(const char* buf, int buf_len); |
| 50 int64 Truncate(int64 bytes); | 50 int64 Truncate(int64 bytes); |
| 51 int Flush(); | 51 int Flush(const CompletionCallback& callback); |
| 52 int FlushSync(); |
| 52 void EnableErrorStatistics(); | 53 void EnableErrorStatistics(); |
| 53 void SetBoundNetLogSource( | 54 void SetBoundNetLogSource( |
| 54 const net::BoundNetLog& owner_bound_net_log); | 55 const net::BoundNetLog& owner_bound_net_log); |
| 55 base::PlatformFile GetPlatformFileForTesting(); | 56 base::PlatformFile GetPlatformFileForTesting(); |
| 56 | 57 |
| 57 // Resets on_io_complete_ and WeakPtr's. | 58 // Resets on_io_complete_ and WeakPtr's. |
| 58 // Called when Read() or Write() is completed. | 59 // Called when Read() or Write() is completed. |
| 59 void ResetOnIOComplete(); | 60 void ResetOnIOComplete(); |
| 60 | 61 |
| 61 private: | 62 private: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 73 net::BoundNetLog bound_net_log_; | 74 net::BoundNetLog bound_net_log_; |
| 74 base::WeakPtrFactory<FileStreamPosix> weak_ptr_factory_; | 75 base::WeakPtrFactory<FileStreamPosix> weak_ptr_factory_; |
| 75 scoped_ptr<base::WaitableEvent> on_io_complete_; | 76 scoped_ptr<base::WaitableEvent> on_io_complete_; |
| 76 | 77 |
| 77 DISALLOW_COPY_AND_ASSIGN(FileStreamPosix); | 78 DISALLOW_COPY_AND_ASSIGN(FileStreamPosix); |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 } // namespace net | 81 } // namespace net |
| 81 | 82 |
| 82 #endif // NET_BASE_FILE_STREAM_POSIX_H | 83 #endif // NET_BASE_FILE_STREAM_POSIX_H |
| OLD | NEW |