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

Side by Side Diff: webkit/glue/cpp_variant.h

Issue 10382059: Quote CppBoundClass/CppVariant in namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix a long line 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 /* 5 /*
6 This file contains the declaration for CppVariant, a type used by C++ classes 6 This file contains the declaration for CppVariant, a type used by C++ classes
7 that are to be bound to JavaScript objects. 7 that are to be bound to JavaScript objects.
8 8
9 CppVariant exists primarily as an interface between C++ callers and the 9 CppVariant exists primarily as an interface between C++ callers and the
10 corresponding NPVariant type. CppVariant also provides a number of 10 corresponding NPVariant type. CppVariant also provides a number of
11 convenience constructors and accessors, so that the NPVariantType values 11 convenience constructors and accessors, so that the NPVariantType values
12 don't need to be exposed, and a destructor to free any memory allocated for 12 don't need to be exposed, and a destructor to free any memory allocated for
13 string values. 13 string values.
14 14
15 For a usage example, see cpp_binding_example.{h|cc}. 15 For a usage example, see cpp_binding_example.{h|cc}.
16 */ 16 */
17 17
18 #ifndef WEBKIT_GLUE_CPP_VARIANT_H__ 18 #ifndef WEBKIT_GLUE_CPP_VARIANT_H__
19 #define WEBKIT_GLUE_CPP_VARIANT_H__ 19 #define WEBKIT_GLUE_CPP_VARIANT_H__
20 20
21 #include <string> 21 #include <string>
22 #include <vector> 22 #include <vector>
23 23
24 #include "base/basictypes.h" 24 #include "base/basictypes.h"
25 #include "third_party/npapi/bindings/npruntime.h" 25 #include "third_party/npapi/bindings/npruntime.h"
26 #include "webkit/glue/webkit_glue_export.h" 26 #include "webkit/glue/webkit_glue_export.h"
27 27
28 namespace webkit_glue {
29
28 class WEBKIT_GLUE_EXPORT CppVariant : public NPVariant { 30 class WEBKIT_GLUE_EXPORT CppVariant : public NPVariant {
29 public: 31 public:
30 CppVariant(); 32 CppVariant();
31 ~CppVariant(); 33 ~CppVariant();
32 void SetNull(); 34 void SetNull();
33 void Set(bool value); 35 void Set(bool value);
34 void Set(int32_t value); 36 void Set(int32_t value);
35 void Set(double value); 37 void Set(double value);
36 38
37 // Note that setting a CppVariant to a string value involves copying the 39 // Note that setting a CppVariant to a string value involves copying the
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 104
103 // Invoke method of the given name on an object with the supplied arguments. 105 // Invoke method of the given name on an object with the supplied arguments.
104 // The first argument should be the object on which the method is to be 106 // The first argument should be the object on which the method is to be
105 // invoked. Returns whether the method was successfully invoked. If the 107 // invoked. Returns whether the method was successfully invoked. If the
106 // method was invoked successfully, any return value is stored in the 108 // method was invoked successfully, any return value is stored in the
107 // CppVariant specified by result. 109 // CppVariant specified by result.
108 bool Invoke(const std::string& method, const CppVariant* args, 110 bool Invoke(const std::string& method, const CppVariant* args,
109 uint32 arg_count, CppVariant& result) const; 111 uint32 arg_count, CppVariant& result) const;
110 }; 112 };
111 113
114 } // namespace webkit_glue
115
112 #endif // WEBKIT_GLUE_CPP_VARIANT_H__ 116 #endif // WEBKIT_GLUE_CPP_VARIANT_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698