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_ELEMENT_READER_H_ | 5 #ifndef NET_BASE_UPLOAD_ELEMENT_READER_H_ |
6 #define NET_BASE_UPLOAD_ELEMENT_READER_H_ | 6 #define NET_BASE_UPLOAD_ELEMENT_READER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "net/base/completion_callback.h" | 9 #include "net/base/completion_callback.h" |
10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
11 | 11 |
12 namespace storage { | |
13 class UploadBlobElementReader; | |
14 } | |
15 | |
12 namespace net { | 16 namespace net { |
13 | 17 |
14 class IOBuffer; | 18 class IOBuffer; |
15 class UploadBytesElementReader; | 19 class UploadBytesElementReader; |
16 class UploadDiskCacheEntryElementReader; | |
17 class UploadFileElementReader; | 20 class UploadFileElementReader; |
18 | 21 |
19 // An interface to read an upload data element. | 22 // An interface to read an upload data element. |
20 class NET_EXPORT UploadElementReader { | 23 class NET_EXPORT UploadElementReader { |
21 public: | 24 public: |
22 UploadElementReader() {} | 25 UploadElementReader() {} |
23 virtual ~UploadElementReader() {} | 26 virtual ~UploadElementReader() {} |
24 | 27 |
25 // Returns this instance's pointer as UploadDiskCacheEntryElementReader when | 28 // Returns this instance's pointer as UploadDiskCacheEntryElementReader when |
26 // possible, otherwise returns nullptr. | 29 // possible, otherwise returns nullptr. |
27 virtual const UploadDiskCacheEntryElementReader* | 30 virtual const storage::UploadBlobElementReader* |
28 AsDiskCacheEntryReaderForTests() const; | 31 AsUploadBlobElementReaderForTests() const; |
mmenke
2015/09/14 19:24:33
This method is a layering violation. Net shouldn'
dmurph
2015/09/14 20:27:50
Sounds good. Done.
| |
29 | 32 |
30 // Returns this instance's pointer as UploadBytesElementReader when possible, | 33 // Returns this instance's pointer as UploadBytesElementReader when possible, |
31 // otherwise returns NULL. | 34 // otherwise returns NULL. |
32 virtual const UploadBytesElementReader* AsBytesReader() const; | 35 virtual const UploadBytesElementReader* AsBytesReader() const; |
33 | 36 |
34 // Returns this instance's pointer as UploadFileElementReader when possible, | 37 // Returns this instance's pointer as UploadFileElementReader when possible, |
35 // otherwise returns NULL. | 38 // otherwise returns NULL. |
36 virtual const UploadFileElementReader* AsFileReader() const; | 39 virtual const UploadFileElementReader* AsFileReader() const; |
37 | 40 |
38 // Initializes the instance synchronously when possible, otherwise does | 41 // Initializes the instance synchronously when possible, otherwise does |
(...skipping 20 matching lines...) Expand all Loading... | |
59 int buf_length, | 62 int buf_length, |
60 const CompletionCallback& callback) = 0; | 63 const CompletionCallback& callback) = 0; |
61 | 64 |
62 private: | 65 private: |
63 DISALLOW_COPY_AND_ASSIGN(UploadElementReader); | 66 DISALLOW_COPY_AND_ASSIGN(UploadElementReader); |
64 }; | 67 }; |
65 | 68 |
66 } // namespace net | 69 } // namespace net |
67 | 70 |
68 #endif // NET_BASE_UPLOAD_ELEMENT_READER_H_ | 71 #endif // NET_BASE_UPLOAD_ELEMENT_READER_H_ |
OLD | NEW |