Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Side by Side Diff: extensions/browser/api/web_request/upload_data_presenter.cc

Issue 2370633002: replace deprecated version of SetWithoutPathExpansion (Closed)
Patch Set: use MakeUnique Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698