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 NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_ | 5 #ifndef NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_ |
6 #define NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_ | 6 #define NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 virtual uint64 GetContentLength() const OVERRIDE; | 47 virtual uint64 GetContentLength() const OVERRIDE; |
48 virtual uint64 BytesRemaining() const OVERRIDE; | 48 virtual uint64 BytesRemaining() const OVERRIDE; |
49 virtual int Read(IOBuffer* buf, | 49 virtual int Read(IOBuffer* buf, |
50 int buf_length, | 50 int buf_length, |
51 const CompletionCallback& callback) OVERRIDE; | 51 const CompletionCallback& callback) OVERRIDE; |
52 | 52 |
53 private: | 53 private: |
54 FRIEND_TEST_ALL_PREFIXES(UploadDataStreamTest, FileSmallerThanLength); | 54 FRIEND_TEST_ALL_PREFIXES(UploadDataStreamTest, FileSmallerThanLength); |
55 FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, | 55 FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, |
56 UploadFileSmallerThanLength); | 56 UploadFileSmallerThanLength); |
57 FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionSpdy2Test, | |
58 UploadFileSmallerThanLength); | |
59 FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionSpdy3Test, | |
60 UploadFileSmallerThanLength); | |
61 | 57 |
62 // Resets this instance to the uninitialized state. | 58 // Resets this instance to the uninitialized state. |
63 void Reset(); | 59 void Reset(); |
64 | 60 |
65 // These methods are used to implement Init(). | 61 // These methods are used to implement Init(). |
66 void OnOpenCompleted(const CompletionCallback& callback, int result); | 62 void OnOpenCompleted(const CompletionCallback& callback, int result); |
67 void OnSeekCompleted(const CompletionCallback& callback, int64 result); | 63 void OnSeekCompleted(const CompletionCallback& callback, int64 result); |
68 void OnGetFileInfoCompleted(const CompletionCallback& callback, | 64 void OnGetFileInfoCompleted(const CompletionCallback& callback, |
69 base::File::Info* file_info, | 65 base::File::Info* file_info, |
70 bool result); | 66 bool result); |
(...skipping 17 matching lines...) Expand all Loading... |
88 uint64 content_length_; | 84 uint64 content_length_; |
89 uint64 bytes_remaining_; | 85 uint64 bytes_remaining_; |
90 base::WeakPtrFactory<UploadFileElementReader> weak_ptr_factory_; | 86 base::WeakPtrFactory<UploadFileElementReader> weak_ptr_factory_; |
91 | 87 |
92 DISALLOW_COPY_AND_ASSIGN(UploadFileElementReader); | 88 DISALLOW_COPY_AND_ASSIGN(UploadFileElementReader); |
93 }; | 89 }; |
94 | 90 |
95 } // namespace net | 91 } // namespace net |
96 | 92 |
97 #endif // NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_ | 93 #endif // NET_BASE_UPLOAD_FILE_ELEMENT_READER_H_ |
OLD | NEW |