Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(704)

Side by Side Diff: ui/aura/window_property.h

Issue 828633002: replace COMPILE_ASSERT with static_assert in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/aura/window_tree_host_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef UI_AURA_WINDOW_PROPERTY_H_ 5 #ifndef UI_AURA_WINDOW_PROPERTY_H_
6 #define UI_AURA_WINDOW_PROPERTY_H_ 6 #define UI_AURA_WINDOW_PROPERTY_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "ui/aura/aura_export.h" 9 #include "ui/aura/aura_export.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } \ 122 } \
123 template<> EXPORT void Window::ClearProperty( \ 123 template<> EXPORT void Window::ClearProperty( \
124 const WindowProperty<T >* property) { \ 124 const WindowProperty<T >* property) { \
125 subtle::PropertyHelper::Clear<T>(this, property); \ 125 subtle::PropertyHelper::Clear<T>(this, property); \
126 } \ 126 } \
127 } 127 }
128 #define DECLARE_WINDOW_PROPERTY_TYPE(T) \ 128 #define DECLARE_WINDOW_PROPERTY_TYPE(T) \
129 DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(, T) 129 DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(, T)
130 130
131 #define DEFINE_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \ 131 #define DEFINE_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \
132 COMPILE_ASSERT(sizeof(TYPE) <= sizeof(int64), property_type_too_large); \ 132 static_assert(sizeof(TYPE) <= sizeof(int64), "property type too large"); \
133 namespace { \ 133 namespace { \
134 const aura::WindowProperty<TYPE> NAME ## _Value = \ 134 const aura::WindowProperty<TYPE> NAME ## _Value = \
135 {DEFAULT, #NAME, nullptr}; \ 135 {DEFAULT, #NAME, nullptr}; \
136 } \ 136 } \
137 const aura::WindowProperty<TYPE>* const NAME = & NAME ## _Value; 137 const aura::WindowProperty<TYPE>* const NAME = & NAME ## _Value;
138 138
139 #define DEFINE_LOCAL_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \ 139 #define DEFINE_LOCAL_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \
140 COMPILE_ASSERT(sizeof(TYPE) <= sizeof(int64), property_type_too_large); \ 140 static_assert(sizeof(TYPE) <= sizeof(int64), "property type too large"); \
141 namespace { \ 141 namespace { \
142 const aura::WindowProperty<TYPE> NAME ## _Value = \ 142 const aura::WindowProperty<TYPE> NAME ## _Value = \
143 {DEFAULT, #NAME, nullptr}; \ 143 {DEFAULT, #NAME, nullptr}; \
144 const aura::WindowProperty<TYPE>* const NAME = & NAME ## _Value; \ 144 const aura::WindowProperty<TYPE>* const NAME = & NAME ## _Value; \
145 } 145 }
146 146
147 #define DEFINE_OWNED_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \ 147 #define DEFINE_OWNED_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \
148 namespace { \ 148 namespace { \
149 void Deallocator ## NAME (int64 p) { \ 149 void Deallocator ## NAME (int64 p) { \
150 enum { type_must_be_complete = sizeof(TYPE) }; \ 150 enum { type_must_be_complete = sizeof(TYPE) }; \
151 delete aura::WindowPropertyCaster<TYPE*>::FromInt64(p); \ 151 delete aura::WindowPropertyCaster<TYPE*>::FromInt64(p); \
152 } \ 152 } \
153 const aura::WindowProperty<TYPE*> NAME ## _Value = \ 153 const aura::WindowProperty<TYPE*> NAME ## _Value = \
154 {DEFAULT,#NAME,&Deallocator ## NAME}; \ 154 {DEFAULT,#NAME,&Deallocator ## NAME}; \
155 } \ 155 } \
156 const aura::WindowProperty<TYPE*>* const NAME = & NAME ## _Value; 156 const aura::WindowProperty<TYPE*>* const NAME = & NAME ## _Value;
157 157
158 #endif // UI_AURA_WINDOW_PROPERTY_H_ 158 #endif // UI_AURA_WINDOW_PROPERTY_H_
OLDNEW
« no previous file with comments | « no previous file | ui/aura/window_tree_host_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698