Chromium Code Reviews| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 209 #define DEFINE_WRAPPERTYPEINFO_NOT_REACHED() \ | 209 #define DEFINE_WRAPPERTYPEINFO_NOT_REACHED() \ |
| 210 public: \ | 210 public: \ |
| 211 virtual const WrapperTypeInfo* wrapperTypeInfo() const override \ | 211 virtual const WrapperTypeInfo* wrapperTypeInfo() const override \ |
| 212 { \ | 212 { \ |
| 213 ASSERT_NOT_REACHED(); \ | 213 ASSERT_NOT_REACHED(); \ |
| 214 return 0; \ | 214 return 0; \ |
| 215 } \ | 215 } \ |
| 216 private: \ | 216 private: \ |
| 217 typedef void end_of_define_wrappertypeinfo_not_reached_t | 217 typedef void end_of_define_wrappertypeinfo_not_reached_t |
| 218 | 218 |
| 219 | |
| 220 // Declares only 'wrapperTypeInfo' not defines. | |
|
Yuki
2015/03/24 11:12:56
nit: Declares 'wrapperTypeInfo' method without def
tasak
2015/03/25 09:01:58
Done.
| |
| 221 // | |
| 222 // This macro is used for template classes. e.g. DOMTypedArray<>. | |
| 223 // To export such a template class X, we need to instantiate X with EXPORT_API, | |
| 224 // i.e. "extern template class EXPORT_API X;" | |
| 225 // However, once we instantiate X, we cannot specialize X after | |
| 226 // the instantiation. i.e. we will see "error: explicit specialization of ... | |
| 227 // after instantiation". So we cannot define X's s_wrapperTypeInfo in generated | |
| 228 // code by using specialization. Instead, we need to implement wrapperTypeInfo | |
| 229 // in X's cpp code, and instantiate X, i.e. "template class X;". | |
| 230 #define DECLARE_WRAPPERTYPEINFO_ONLY() \ | |
|
Yuki
2015/03/24 11:12:56
nit: DECLARE_WRAPPERTYPEINFO()
"declare A only" s
tasak
2015/03/25 09:01:58
Done.
| |
| 231 public: \ | |
| 232 virtual const WrapperTypeInfo* wrapperTypeInfo() const override | |
|
Yuki
2015/03/24 11:12:56
We need a trick of "private: typedef end_of_declar
tasak
2015/03/25 09:01:58
Done.
| |
| 233 | |
| 219 } // namespace blink | 234 } // namespace blink |
| 220 | 235 |
| 221 #endif // ScriptWrappable_h | 236 #endif // ScriptWrappable_h |
| OLD | NEW |