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

Unified Diff: webkit/glue/cpp_variant.h

Issue 6254018: Allow chrome.send to pass number, boolean, null and arrays of those (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: code review changes Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/dom_ui_bindings.cc ('k') | webkit/glue/cpp_variant.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/cpp_variant.h
diff --git a/webkit/glue/cpp_variant.h b/webkit/glue/cpp_variant.h
index 34f843a90a2cb31d811e89c865454a87f6907362..01efd7da4d66e9600d0a1acb8219d4748f194d67 100644
--- a/webkit/glue/cpp_variant.h
+++ b/webkit/glue/cpp_variant.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -89,14 +89,15 @@ class CppVariant : public NPVariant {
bool isObject() const { return (type == NPVariantType_Object); }
// Converters. The CppVariant must be of a type convertible to these values.
- // For example, ToInteger() works only if isNumber() is true.
+ // For example, ToInt32() works only if isNumber() is true.
std::string ToString() const;
int32_t ToInt32() const;
double ToDouble() const;
bool ToBoolean() const;
- // Returns a vector of strings for the specified argument. This is useful
- // for converting a JavaScript array of strings into a vector of strings.
- std::vector<std::string> ToStringVector() const;
+ // Returns a vector of CppVariant for the specified variant. This should only
+ // be called on an Object. If the object has no "length" property an empty
+ // vector is returned.
+ std::vector<CppVariant> ToVector() const;
// Invoke method of the given name on an object with the supplied arguments.
// The first argument should be the object on which the method is to be
« no previous file with comments | « chrome/renderer/dom_ui_bindings.cc ('k') | webkit/glue/cpp_variant.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698