Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 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 |
| 11 lists needed to bind this class to a JS object. They should also declare | 11 lists needed to bind this class to a JS object. They should also declare |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 24 #include "webkit/glue/cpp_variant.h" | 24 #include "webkit/glue/cpp_variant.h" |
| 25 | 25 |
| 26 #include "base/callback.h" | 26 #include "base/callback.h" |
| 27 #include "base/memory/scoped_ptr.h" | 27 #include "base/memory/scoped_ptr.h" |
| 28 #include "webkit/glue/webkit_glue_export.h" | 28 #include "webkit/glue/webkit_glue_export.h" |
| 29 | 29 |
| 30 namespace WebKit { | 30 namespace WebKit { |
| 31 class WebFrame; | 31 class WebFrame; |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace webkit_glue { | |
| 35 | |
| 34 typedef std::vector<CppVariant> CppArgumentList; | 36 typedef std::vector<CppVariant> CppArgumentList; |
| 35 | 37 |
| 36 // CppBoundClass lets you map Javascript method calls and property accesses | 38 // CppBoundClass lets you map Javascript method calls and property accesses |
| 37 // directly to C++ method calls and CppVariant* variable access. | 39 // directly to C++ method calls and CppVariant* variable access. |
| 38 class WEBKIT_GLUE_EXPORT CppBoundClass { | 40 class WEBKIT_GLUE_EXPORT CppBoundClass { |
| 39 public: | 41 public: |
| 40 class PropertyCallback { | 42 class PropertyCallback { |
| 41 public: | 43 public: |
| 42 virtual ~PropertyCallback() { } | 44 virtual ~PropertyCallback() { } |
| 43 | 45 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 // reference to this object, and it is released on deletion. | 135 // reference to this object, and it is released on deletion. |
| 134 CppVariant self_variant_; | 136 CppVariant self_variant_; |
| 135 | 137 |
| 136 // True if our np_object has been bound to a WebFrame, in which case it must | 138 // True if our np_object has been bound to a WebFrame, in which case it must |
| 137 // be unregistered with V8 when we delete it. | 139 // be unregistered with V8 when we delete it. |
| 138 bool bound_to_frame_; | 140 bool bound_to_frame_; |
| 139 | 141 |
| 140 DISALLOW_COPY_AND_ASSIGN(CppBoundClass); | 142 DISALLOW_COPY_AND_ASSIGN(CppBoundClass); |
| 141 }; | 143 }; |
| 142 | 144 |
| 145 } // namespace webkit_glue | |
| 146 | |
| 147 // TODO(wangxianzhu): This is temporary to resolve crbug.com/127238 with minimal | |
| 148 // code change. Eventually we will replace CppBoundClass/CppVariant with V8 API. | |
| 149 using webkit_glue::CppArgumentList; | |
| 150 using webkit_glue::CppBoundClass; | |
|
tony
2012/05/08 17:27:39
Please just fix all the callers. There aren't tha
Xianzhu
2012/05/08 19:38:03
Done.
| |
| 151 | |
| 143 #endif // CPP_BOUNDCLASS_H__ | 152 #endif // CPP_BOUNDCLASS_H__ |
| OLD | NEW |