OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef PPAPI_CPP_VAR_H_ | 5 #ifndef PPAPI_CPP_VAR_H_ |
6 #define PPAPI_CPP_VAR_H_ | 6 #define PPAPI_CPP_VAR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ppapi/c/pp_module.h" | 11 #include "ppapi/c/pp_module.h" |
12 #include "ppapi/c/pp_var.h" | 12 #include "ppapi/c/pp_var.h" |
13 | 13 |
14 | 14 |
15 /// @file | 15 /// @file |
16 /// This file defines the API for handling the passing of data types between | 16 /// This file defines the API for handling the passing of data types between |
17 /// your module and the page. | 17 /// your module and the page. |
18 namespace pp { | 18 namespace pp { |
19 | 19 |
20 class Instance; | |
21 | |
22 /// A generic type used for passing data types between the module and the page. | 20 /// A generic type used for passing data types between the module and the page. |
23 class Var { | 21 class Var { |
24 public: | 22 public: |
25 /// Special value passed to constructor to make <code>NULL</code>. | 23 /// Special value passed to constructor to make <code>NULL</code>. |
26 struct Null {}; | 24 struct Null {}; |
27 | 25 |
28 /// Default constructor. Creates a <code>Var</code> of type | 26 /// Default constructor. Creates a <code>Var</code> of type |
29 /// <code>Undefined</code>. | 27 /// <code>Undefined</code>. |
30 Var(); | 28 Var(); |
31 | 29 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 284 |
287 protected: | 285 protected: |
288 PP_Var var_; | 286 PP_Var var_; |
289 bool needs_release_; | 287 bool needs_release_; |
290 | 288 |
291 private: | 289 private: |
292 // Prevent an arbitrary pointer argument from being implicitly converted to | 290 // Prevent an arbitrary pointer argument from being implicitly converted to |
293 // a bool at Var construction. If somebody makes such a mistake, (s)he will | 291 // a bool at Var construction. If somebody makes such a mistake, (s)he will |
294 // get a compilation error. | 292 // get a compilation error. |
295 Var(void* non_scriptable_object_pointer); | 293 Var(void* non_scriptable_object_pointer); |
296 | |
297 }; | 294 }; |
298 | 295 |
299 } // namespace pp | 296 } // namespace pp |
300 | 297 |
301 #endif // PPAPI_CPP_VAR_H_ | 298 #endif // PPAPI_CPP_VAR_H_ |
OLD | NEW |