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

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

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: 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
« no previous file with comments | « extensions/renderer/api_request_handler.cc ('k') | extensions/renderer/argument_spec.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 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 SetCallback(value.As<v8::Function>()); 227 SetCallback(value.As<v8::Function>());
228 return true; 228 return true;
229 } 229 }
230 230
231 } // namespace 231 } // namespace
232 232
233 APISignature::APISignature(const base::ListValue& specification) { 233 APISignature::APISignature(const base::ListValue& specification) {
234 signature_.reserve(specification.GetSize()); 234 signature_.reserve(specification.GetSize());
235 for (const auto& value : specification) { 235 for (const auto& value : specification) {
236 const base::DictionaryValue* param = nullptr; 236 const base::DictionaryValue* param = nullptr;
237 CHECK(value.GetAsDictionary(&param)); 237 CHECK(value->GetAsDictionary(&param));
238 signature_.push_back(base::MakeUnique<ArgumentSpec>(*param)); 238 signature_.push_back(base::MakeUnique<ArgumentSpec>(*param));
239 } 239 }
240 } 240 }
241 241
242 APISignature::APISignature(std::vector<std::unique_ptr<ArgumentSpec>> signature) 242 APISignature::APISignature(std::vector<std::unique_ptr<ArgumentSpec>> signature)
243 : signature_(std::move(signature)) {} 243 : signature_(std::move(signature)) {}
244 244
245 APISignature::~APISignature() {} 245 APISignature::~APISignature() {}
246 246
247 bool APISignature::ParseArgumentsToV8( 247 bool APISignature::ParseArgumentsToV8(
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 return false; 313 return false;
314 json->Append(std::move(converted)); 314 json->Append(std::move(converted));
315 } 315 }
316 316
317 *json_out = std::move(json); 317 *json_out = std::move(json);
318 *callback_out = callback; 318 *callback_out = callback;
319 return true; 319 return true;
320 } 320 }
321 321
322 } // namespace extensions 322 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/api_request_handler.cc ('k') | extensions/renderer/argument_spec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698