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

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

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 years, 6 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
« no previous file with comments | « extensions/browser/api/serial/serial_apitest.cc ('k') | extensions/browser/extension_prefs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 28 matching lines...) Expand all
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
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
OLDNEW
« no previous file with comments | « extensions/browser/api/serial/serial_apitest.cc ('k') | extensions/browser/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698