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

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: Syncing to the latest tree after a week away. 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 namespace extensions {
8
9 bool ReadOneOrMoreIntegers(base::Value* value, std::vector<int>* result) {
10 if (value->IsType(Value::TYPE_INTEGER)) {
11 int v = -1;
12 if (!value->GetAsInteger(&v))
13 return false;
14 result->push_back(v);
15 return true;
16
17 } else if (value->IsType(Value::TYPE_LIST)) {
18 base::ListValue* values = static_cast<base::ListValue*>(value);
19 for (size_t i = 0; i < values->GetSize(); ++i) {
20 int v = -1;
21 if (!values->GetInteger(i, &v))
22 return false;
23 result->push_back(v);
24 }
25 return true;
26 }
27 return false;
28 }
29
30 } // namespace extensions
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