| 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/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 namespace keys = extension_web_request_api_constants; | 23 namespace keys = extension_web_request_api_constants; |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 // Takes |dictionary| of <string, list of strings> pairs, and gets the list | 27 // Takes |dictionary| of <string, list of strings> pairs, and gets the list |
| 28 // for |key|, creating it if necessary. | 28 // for |key|, creating it if necessary. |
| 29 base::ListValue* GetOrCreateList(base::DictionaryValue* dictionary, | 29 base::ListValue* GetOrCreateList(base::DictionaryValue* dictionary, |
| 30 const std::string& key) { | 30 const std::string& key) { |
| 31 base::ListValue* list = nullptr; | 31 base::ListValue* list = nullptr; |
| 32 if (!dictionary->GetList(key, &list)) { | 32 if (!dictionary->GetList(key, &list)) { |
| 33 list = new base::ListValue(); | 33 dictionary->SetWithoutPathExpansion(key, |
| 34 dictionary->SetWithoutPathExpansion(key, base::WrapUnique(list)); | 34 base::MakeUnique<base::ListValue>()); |
| 35 dictionary->GetListWithoutPathExpansion(key, &list); |
| 35 } | 36 } |
| 36 return list; | 37 return list; |
| 37 } | 38 } |
| 38 | 39 |
| 39 } // namespace | 40 } // namespace |
| 40 | 41 |
| 41 namespace extensions { | 42 namespace extensions { |
| 42 | 43 |
| 43 namespace subtle { | 44 namespace subtle { |
| 44 | 45 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 dictionary_(success_ ? new base::DictionaryValue() : NULL) { | 156 dictionary_(success_ ? new base::DictionaryValue() : NULL) { |
| 156 } | 157 } |
| 157 | 158 |
| 158 void ParsedDataPresenter::Abort() { | 159 void ParsedDataPresenter::Abort() { |
| 159 success_ = false; | 160 success_ = false; |
| 160 dictionary_.reset(); | 161 dictionary_.reset(); |
| 161 parser_.reset(); | 162 parser_.reset(); |
| 162 } | 163 } |
| 163 | 164 |
| 164 } // namespace extensions | 165 } // namespace extensions |
| OLD | NEW |