| 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 EXTENSIONS_BROWSER_API_WEB_REQUEST_UPLOAD_DATA_PRESENTER_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_WEB_REQUEST_UPLOAD_DATA_PRESENTER_H_ |
| 6 #define EXTENSIONS_BROWSER_API_WEB_REQUEST_UPLOAD_DATA_PRESENTER_H_ | 6 #define EXTENSIONS_BROWSER_API_WEB_REQUEST_UPLOAD_DATA_PRESENTER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 class URLRequest; | 28 class URLRequest; |
| 29 class UploadElementReader; | 29 class UploadElementReader; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace extensions { | 32 namespace extensions { |
| 33 | 33 |
| 34 namespace subtle { | 34 namespace subtle { |
| 35 | 35 |
| 36 // Helpers shared with unit-tests. | 36 // Helpers shared with unit-tests. |
| 37 | 37 |
| 38 // Appends a dictionary {'key': 'value'} to |list|. |list| becomes the owner of | 38 // Appends a dictionary {'key': 'value'} to |list|. |
| 39 // |value|. | |
| 40 void AppendKeyValuePair(const char* key, | 39 void AppendKeyValuePair(const char* key, |
| 41 base::Value* value, | 40 std::unique_ptr<base::Value> value, |
| 42 base::ListValue* list); | 41 base::ListValue* list); |
| 43 | 42 |
| 44 } // namespace subtle | 43 } // namespace subtle |
| 45 | 44 |
| 46 FORWARD_DECLARE_TEST(WebRequestUploadDataPresenterTest, RawData); | 45 FORWARD_DECLARE_TEST(WebRequestUploadDataPresenterTest, RawData); |
| 47 | 46 |
| 48 // UploadDataPresenter is an interface for objects capable to consume a series | 47 // UploadDataPresenter is an interface for objects capable to consume a series |
| 49 // of UploadElementReader and represent this data as a base:Value. | 48 // of UploadElementReader and represent this data as a base:Value. |
| 50 // | 49 // |
| 51 // Workflow for objects implementing this interface: | 50 // Workflow for objects implementing this interface: |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 std::unique_ptr<FormDataParser> parser_; | 122 std::unique_ptr<FormDataParser> parser_; |
| 124 bool success_; | 123 bool success_; |
| 125 std::unique_ptr<base::DictionaryValue> dictionary_; | 124 std::unique_ptr<base::DictionaryValue> dictionary_; |
| 126 | 125 |
| 127 DISALLOW_COPY_AND_ASSIGN(ParsedDataPresenter); | 126 DISALLOW_COPY_AND_ASSIGN(ParsedDataPresenter); |
| 128 }; | 127 }; |
| 129 | 128 |
| 130 } // namespace extensions | 129 } // namespace extensions |
| 131 | 130 |
| 132 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_UPLOAD_DATA_PRESENTER_H_ | 131 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_UPLOAD_DATA_PRESENTER_H_ |
| OLD | NEW |