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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 // indirectly, must write this macro in the class definition. | 249 // indirectly, must write this macro in the class definition. |
250 #define DEFINE_WRAPPERTYPEINFO() \ | 250 #define DEFINE_WRAPPERTYPEINFO() \ |
251 public: \ | 251 public: \ |
252 virtual const WrapperTypeInfo* wrapperTypeInfo() const override \ | 252 virtual const WrapperTypeInfo* wrapperTypeInfo() const override \ |
253 { \ | 253 { \ |
254 return &s_wrapperTypeInfo; \ | 254 return &s_wrapperTypeInfo; \ |
255 } \ | 255 } \ |
256 private: \ | 256 private: \ |
257 static const WrapperTypeInfo& s_wrapperTypeInfo | 257 static const WrapperTypeInfo& s_wrapperTypeInfo |
258 | 258 |
| 259 // Defines 'wrapperTypeInfo' virtual method, which should never be called. |
| 260 // |
| 261 // This macro is used when there exists a class hierarchy with a root class |
| 262 // and most of the subclasses are script-wrappable but not all of them. |
| 263 // In that case, the root class can inherit from ScriptWrappable and use |
| 264 // this macro, and let subclasses have a choice whether or not use |
| 265 // DEFINE_WRAPPERTYPEINFO macro. The script-wrappable subclasses which have |
| 266 // corresponding IDL file must call DEFINE_WRAPPERTYPEINFO, and the others |
| 267 // must not. |
| 268 #define DEFINE_WRAPPERTYPEINFO_NOT_REACHED() \ |
| 269 public: \ |
| 270 virtual const WrapperTypeInfo* wrapperTypeInfo() const override \ |
| 271 { \ |
| 272 ASSERT_NOT_REACHED(); \ |
| 273 return 0; \ |
| 274 } \ |
| 275 private: \ |
| 276 typedef void end_of_define_wrappertypeinfo_not_reached_t |
| 277 |
259 } // namespace blink | 278 } // namespace blink |
260 | 279 |
261 #endif // ScriptWrappable_h | 280 #endif // ScriptWrappable_h |
OLD | NEW |