Commit 8d88b6d2 authored by oshima@chromium.org's avatar oshima@chromium.org

Use unique name for property deallocator.

Move type completeness check into functino.
 anonymous namespaces within the same namespace are treated as the same namespace. This is to avoid  duplicated definitions.

BUG=none
TEST=none


Review URL: https://chromiumcodereview.appspot.com/10533063

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141243 0039d316-1c4b-4281-b951-d872f2087c98
parent 06b5c2d9
...@@ -129,14 +129,14 @@ void Window::ClearProperty(const WindowProperty<T>* property) { ...@@ -129,14 +129,14 @@ void Window::ClearProperty(const WindowProperty<T>* property) {
} }
#define DEFINE_OWNED_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \ #define DEFINE_OWNED_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \
namespace { \ namespace { \
enum { type_must_be_complete = sizeof(TYPE) }; \ void Deallocator ## NAME (intptr_t p) { \
void Deallocator(intptr_t p) { \ enum { type_must_be_complete = sizeof(TYPE) }; \
delete aura::WindowPropertyCaster<TYPE*>::FromIntptrT(p); \ delete aura::WindowPropertyCaster<TYPE*>::FromIntptrT(p); \
} \ } \
const aura::WindowProperty<TYPE*> NAME ## _Value = \ const aura::WindowProperty<TYPE*> NAME ## _Value = \
{DEFAULT,#NAME,&Deallocator}; \ {DEFAULT,#NAME,&Deallocator ## NAME}; \
} \ } \
const aura::WindowProperty<TYPE*>* const NAME = & NAME ## _Value; const aura::WindowProperty<TYPE*>* const NAME = & NAME ## _Value;
#endif // UI_AURA_WINDOW_PROPERTY_H_ #endif // UI_AURA_WINDOW_PROPERTY_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment