OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 FetchDataConsumerHandle_h | 5 #ifndef FetchDataConsumerHandle_h |
6 #define FetchDataConsumerHandle_h | 6 #define FetchDataConsumerHandle_h |
7 | 7 |
8 #include "modules/ModulesExport.h" | 8 #include "modules/ModulesExport.h" |
9 #include "platform/blob/BlobData.h" | 9 #include "platform/blob/BlobData.h" |
10 #include "platform/network/EncodedFormData.h" | 10 #include "platform/network/EncodedFormData.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // return a non-null blob handle with unspecified size. | 56 // return a non-null blob handle with unspecified size. |
57 // The type of the returned handle may not be meaningful. | 57 // The type of the returned handle may not be meaningful. |
58 virtual PassRefPtr<BlobDataHandle> drainAsBlobDataHandle(BlobSizePolicy
= DisallowBlobWithInvalidSize) { return nullptr; } | 58 virtual PassRefPtr<BlobDataHandle> drainAsBlobDataHandle(BlobSizePolicy
= DisallowBlobWithInvalidSize) { return nullptr; } |
59 | 59 |
60 // Drains the data as an EncodedFormData. | 60 // Drains the data as an EncodedFormData. |
61 // This function returns a non-null form data when the handle is made | 61 // This function returns a non-null form data when the handle is made |
62 // from an EncodedFormData-convertible value. | 62 // from an EncodedFormData-convertible value. |
63 virtual PassRefPtr<EncodedFormData> drainAsFormData() { return nullptr;
} | 63 virtual PassRefPtr<EncodedFormData> drainAsFormData() { return nullptr;
} |
64 }; | 64 }; |
65 | 65 |
66 // TODO(yhirano): obtainReader() is currently non-virtual override, and | 66 std::unique_ptr<WebDataConsumerHandle::Reader> obtainReader(Client*) final; |
67 // will be changed into virtual override when we can use unique_ptr in | 67 virtual std::unique_ptr<Reader> obtainFetchDataReader(Client*) = 0; |
68 // Blink. | |
69 std::unique_ptr<Reader> obtainReader(Client* client) { return wrapUnique(obt
ainReaderInternal(client)); } | |
70 | |
71 private: | |
72 Reader* obtainReaderInternal(Client*) override = 0; | |
73 }; | 68 }; |
74 | 69 |
75 } // namespace blink | 70 } // namespace blink |
76 | 71 |
77 #endif // FetchDataConsumerHandle_h | 72 #endif // FetchDataConsumerHandle_h |
OLD | NEW |