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 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 /// | 61 /// |
62 /// You will not normally need to use this constructor because | 62 /// You will not normally need to use this constructor because |
63 /// the reference count will not normally be incremented for you. | 63 /// the reference count will not normally be incremented for you. |
64 Var(PassRef, PP_Var var) { | 64 Var(PassRef, PP_Var var) { |
65 var_ = var; | 65 var_ = var; |
66 needs_release_ = true; | 66 needs_release_ = true; |
67 } | 67 } |
68 | 68 |
69 struct DontManage {}; | 69 struct DontManage {}; |
70 | 70 |
71 /// TODO(brettw): remove DontManage when this bug is fixed | 71 // TODO(brettw): remove DontManage when this bug is fixed |
72 /// http://code.google.com/p/chromium/issues/detail?id=52105 | 72 /// http://code.google.com/p/chromium/issues/detail?id=52105 |
73 /// This constructor is used when we've given a <code>PP_Var</code> as an | 73 /// This constructor is used when we've given a <code>PP_Var</code> as an |
74 /// input argument from somewhere and that reference is managing the | 74 /// input argument from somewhere and that reference is managing the |
75 /// reference count for us. The object will not have its reference count | 75 /// reference count for us. The object will not have its reference count |
76 /// increased or decreased by this class instance. | 76 /// increased or decreased by this class instance. |
77 /// | 77 /// |
78 /// @param[in] var A <code>Var</code>. | 78 /// @param[in] var A <code>Var</code>. |
79 Var(DontManage, PP_Var var) { | 79 Var(DontManage, PP_Var var) { |
80 var_ = var; | 80 var_ = var; |
81 needs_release_ = false; | 81 needs_release_ = false; |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 private: | 291 private: |
292 // Prevent an arbitrary pointer argument from being implicitly converted to | 292 // 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 | 293 // a bool at Var construction. If somebody makes such a mistake, (s)he will |
294 // get a compilation error. | 294 // get a compilation error. |
295 Var(void* non_scriptable_object_pointer); | 295 Var(void* non_scriptable_object_pointer); |
296 }; | 296 }; |
297 | 297 |
298 } // namespace pp | 298 } // namespace pp |
299 | 299 |
300 #endif // PPAPI_CPP_VAR_H_ | 300 #endif // PPAPI_CPP_VAR_H_ |
OLD | NEW |