OLD | NEW |
1 // Copyright (c) 2012 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 CppBoundClass class: | 6 CppBoundClass class: |
7 This base class serves as a parent for C++ classes designed to be bound to | 7 This base class serves as a parent for C++ classes designed to be bound to |
8 JavaScript objects. | 8 JavaScript objects. |
9 | 9 |
10 Subclasses should define the constructor to build the property and method | 10 Subclasses should define the constructor to build the property and method |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 bool Invoke(NPIdentifier ident, const NPVariant* args, size_t arg_count, | 126 bool Invoke(NPIdentifier ident, const NPVariant* args, size_t arg_count, |
127 NPVariant* result); | 127 NPVariant* result); |
128 bool HasProperty(NPIdentifier ident) const; | 128 bool HasProperty(NPIdentifier ident) const; |
129 bool GetProperty(NPIdentifier ident, NPVariant* result) const; | 129 bool GetProperty(NPIdentifier ident, NPVariant* result) const; |
130 bool SetProperty(NPIdentifier ident, const NPVariant* value); | 130 bool SetProperty(NPIdentifier ident, const NPVariant* value); |
131 | 131 |
132 // A lazily-initialized CppVariant representing this class. We retain 1 | 132 // A lazily-initialized CppVariant representing this class. We retain 1 |
133 // reference to this object, and it is released on deletion. | 133 // reference to this object, and it is released on deletion. |
134 CppVariant self_variant_; | 134 CppVariant self_variant_; |
135 | 135 |
136 // True if our np_object has been bound to a WebFrame, in which case it must | 136 // TODO(wez): Remove once crrev.com/14019005 lands. |
137 // be unregistered with V8 when we delete it. | |
138 bool bound_to_frame_; | 137 bool bound_to_frame_; |
139 | 138 |
| 139 // Dummy NPP to use to register as owner for NPObjects. |
| 140 scoped_ptr<NPP_t> npp_; |
| 141 |
140 DISALLOW_COPY_AND_ASSIGN(CppBoundClass); | 142 DISALLOW_COPY_AND_ASSIGN(CppBoundClass); |
141 }; | 143 }; |
142 | 144 |
143 } // namespace webkit_glue | 145 } // namespace webkit_glue |
144 | 146 |
145 #endif // WEBKIT_GLUE_CPP_BOUND_CLASS_H_ | 147 #endif // WEBKIT_GLUE_CPP_BOUND_CLASS_H_ |
OLD | NEW |