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

Side by Side Diff: chrome/browser/extensions/extension_function_util.cc

Issue 10175008: Improving the process model extension API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing feedback by Matt. Created 8 years, 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/extension_function_util.h"
6
7 bool ExtensionFuncUtil::ReadOneOrMoreIntegers(base::Value* value,
Matt Perry 2012/05/08 01:00:34 nit: just make the function global. classes of sta
nasko 2012/05/08 16:39:50 Done.
8 std::vector<int>* result) {
9 if (value->IsType(Value::TYPE_INTEGER)) {
10 int v = -1;
11 if (!value->GetAsInteger(&v))
12 return false;
13 result->push_back(v);
14 return true;
15
16 } else if (value->IsType(Value::TYPE_LIST)) {
17 base::ListValue* values = static_cast<base::ListValue*>(value);
18 for (size_t i = 0; i < values->GetSize(); ++i) {
19 int v = -1;
20 if (!values->GetInteger(i, &v))
21 return false;
22 result->push_back(v);
23 }
24 return true;
25 }
26 return false;
27 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_function_util.h ('k') | chrome/browser/extensions/extension_processes_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698