| 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 #include "extensions/browser/api/web_request/upload_data_presenter.h" | 5 #include "extensions/browser/api/web_request/upload_data_presenter.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 } // namespace | 40 } // namespace |
| 41 | 41 |
| 42 namespace extensions { | 42 namespace extensions { |
| 43 | 43 |
| 44 namespace subtle { | 44 namespace subtle { |
| 45 | 45 |
| 46 void AppendKeyValuePair(const char* key, | 46 void AppendKeyValuePair(const char* key, |
| 47 base::Value* value, | 47 base::Value* value, |
| 48 base::ListValue* list) { | 48 base::ListValue* list) { |
| 49 base::DictionaryValue* dictionary = new base::DictionaryValue; | 49 std::unique_ptr<base::DictionaryValue> dictionary(new base::DictionaryValue); |
| 50 dictionary->SetWithoutPathExpansion(key, value); | 50 dictionary->SetWithoutPathExpansion(key, value); |
| 51 list->Append(dictionary); | 51 list->Append(std::move(dictionary)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 } // namespace subtle | 54 } // namespace subtle |
| 55 | 55 |
| 56 UploadDataPresenter::~UploadDataPresenter() {} | 56 UploadDataPresenter::~UploadDataPresenter() {} |
| 57 | 57 |
| 58 RawDataPresenter::RawDataPresenter() | 58 RawDataPresenter::RawDataPresenter() |
| 59 : success_(true), | 59 : success_(true), |
| 60 list_(new base::ListValue) { | 60 list_(new base::ListValue) { |
| 61 } | 61 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 dictionary_(success_ ? new base::DictionaryValue() : NULL) { | 156 dictionary_(success_ ? new base::DictionaryValue() : NULL) { |
| 157 } | 157 } |
| 158 | 158 |
| 159 void ParsedDataPresenter::Abort() { | 159 void ParsedDataPresenter::Abort() { |
| 160 success_ = false; | 160 success_ = false; |
| 161 dictionary_.reset(); | 161 dictionary_.reset(); |
| 162 parser_.reset(); | 162 parser_.reset(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace extensions | 165 } // namespace extensions |
| OLD | NEW |