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

Side by Side Diff: extensions/renderer/api_signature.cc

Issue 2792573002: Remove base::Value::CreateNullValue (Closed)
Patch Set: Rebase Created 3 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/renderer/api_signature.h" 5 #include "extensions/renderer/api_signature.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 const APITypeReferenceMap& type_refs, 125 const APITypeReferenceMap& type_refs,
126 std::string* error, 126 std::string* error,
127 base::ListValue* list_value) 127 base::ListValue* list_value)
128 : ArgumentParser(context, signature, arguments, type_refs, error), 128 : ArgumentParser(context, signature, arguments, type_refs, error),
129 list_value_(list_value) {} 129 list_value_(list_value) {}
130 130
131 v8::Local<v8::Function> callback() { return callback_; } 131 v8::Local<v8::Function> callback() { return callback_; }
132 132
133 private: 133 private:
134 void AddNull() override { 134 void AddNull() override {
135 list_value_->Append(base::Value::CreateNullValue()); 135 list_value_->Append(base::MakeUnique<base::Value>());
136 } 136 }
137 void AddNullCallback() override { 137 void AddNullCallback() override {
138 // The base::Value conversion doesn't include the callback directly, so we 138 // The base::Value conversion doesn't include the callback directly, so we
139 // don't add a null parameter here. 139 // don't add a null parameter here.
140 } 140 }
141 std::unique_ptr<base::Value>* GetBuffer() override { return &last_arg_; } 141 std::unique_ptr<base::Value>* GetBuffer() override { return &last_arg_; }
142 void AddParsedArgument(v8::Local<v8::Value> value) override { 142 void AddParsedArgument(v8::Local<v8::Value> value) override {
143 // The corresponding base::Value is expected to have been stored in 143 // The corresponding base::Value is expected to have been stored in
144 // |last_arg_| already. 144 // |last_arg_| already.
145 DCHECK(last_arg_); 145 DCHECK(last_arg_);
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 return false; 312 return false;
313 json->Append(std::move(converted)); 313 json->Append(std::move(converted));
314 } 314 }
315 315
316 *json_out = std::move(json); 316 *json_out = std::move(json);
317 *callback_out = callback; 317 *callback_out = callback;
318 return true; 318 return true;
319 } 319 }
320 320
321 } // namespace extensions 321 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/permissions/manifest_permission_set_unittest.cc ('k') | extensions/renderer/script_injection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698