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