OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 24 matching lines...) Expand all Loading... |
35 CppVariant exists primarily as an interface between C++ callers and the | 35 CppVariant exists primarily as an interface between C++ callers and the |
36 corresponding NPVariant type. CppVariant also provides a number of | 36 corresponding NPVariant type. CppVariant also provides a number of |
37 convenience constructors and accessors, so that the NPVariantType values | 37 convenience constructors and accessors, so that the NPVariantType values |
38 don't need to be exposed, and a destructor to free any memory allocated for | 38 don't need to be exposed, and a destructor to free any memory allocated for |
39 string values. | 39 string values. |
40 */ | 40 */ |
41 | 41 |
42 #ifndef CppVariant_h | 42 #ifndef CppVariant_h |
43 #define CppVariant_h | 43 #define CppVariant_h |
44 | 44 |
45 #include "public/platform/WebNonCopyable.h" | |
46 #include "public/web/WebBindings.h" | 45 #include "public/web/WebBindings.h" |
47 #include <string> | 46 #include <string> |
48 #include <vector> | 47 #include <vector> |
49 | 48 |
50 namespace WebTestRunner { | 49 namespace WebTestRunner { |
51 | 50 |
52 class CppVariant : public NPVariant, public WebKit::WebNonCopyable { | 51 class CppVariant : public NPVariant { |
53 public: | 52 public: |
54 CppVariant(); | 53 CppVariant(); |
55 ~CppVariant(); | 54 ~CppVariant(); |
56 void setNull(); | 55 void setNull(); |
57 void set(bool); | 56 void set(bool); |
58 void set(int32_t); | 57 void set(int32_t); |
59 void set(double); | 58 void set(double); |
60 | 59 |
61 // Note that setting a CppVariant to a string value involves copying the | 60 // Note that setting a CppVariant to a string value involves copying the |
62 // string data, which must be freed with a call to freeData() when the | 61 // string data, which must be freed with a call to freeData() when the |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // invoked. Returns whether the method was successfully invoked. If the | 135 // invoked. Returns whether the method was successfully invoked. If the |
137 // method was invoked successfully, any return value is stored in the | 136 // method was invoked successfully, any return value is stored in the |
138 // CppVariant specified by result. | 137 // CppVariant specified by result. |
139 bool invokeDefault(const CppVariant* arguments, | 138 bool invokeDefault(const CppVariant* arguments, |
140 uint32_t argumentCount, CppVariant& result) const; | 139 uint32_t argumentCount, CppVariant& result) const; |
141 }; | 140 }; |
142 | 141 |
143 } | 142 } |
144 | 143 |
145 #endif // CppVariant_h | 144 #endif // CppVariant_h |
OLD | NEW |