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

Side by Side Diff: Source/modules/screen_orientation/ScreenOrientation.cpp

Issue 813903002: replace COMPILE_ASSERT with static_assert in modules/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase on master Created 6 years 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 | « Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "config.h" 5 #include "config.h"
6 #include "modules/screen_orientation/ScreenOrientation.h" 6 #include "modules/screen_orientation/ScreenOrientation.h"
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h" 9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "core/dom/DOMException.h" 10 #include "core/dom/DOMException.h"
11 #include "core/dom/Document.h" 11 #include "core/dom/Document.h"
12 #include "core/dom/ExceptionCode.h" 12 #include "core/dom/ExceptionCode.h"
13 #include "core/frame/LocalFrame.h" 13 #include "core/frame/LocalFrame.h"
14 #include "modules/EventTargetModules.h" 14 #include "modules/EventTargetModules.h"
15 #include "modules/screen_orientation/LockOrientationCallback.h" 15 #include "modules/screen_orientation/LockOrientationCallback.h"
16 #include "modules/screen_orientation/ScreenOrientationController.h" 16 #include "modules/screen_orientation/ScreenOrientationController.h"
17 #include "public/platform/WebScreenOrientationType.h" 17 #include "public/platform/WebScreenOrientationType.h"
18 18
19 // This code assumes that WebScreenOrientationType values are included in WebScr eenOrientationLockType. 19 // This code assumes that WebScreenOrientationType values are included in WebScr eenOrientationLockType.
20 #define COMPILE_ASSERT_MATCHING_ENUM(enum1, enum2) \ 20 #define STATIC_ASSERT_MATCHING_ENUM(enum1, enum2) \
21 COMPILE_ASSERT(static_cast<unsigned>(blink::enum1) == static_cast<unsigned>( blink::enum2), mismatching_types) 21 static_assert(static_cast<unsigned>(blink::enum1) == static_cast<unsigned>(b link::enum2), "mismatching enum values")
22 COMPILE_ASSERT_MATCHING_ENUM(WebScreenOrientationPortraitPrimary, WebScreenOrien tationLockPortraitPrimary); 22 STATIC_ASSERT_MATCHING_ENUM(WebScreenOrientationPortraitPrimary, WebScreenOrient ationLockPortraitPrimary);
23 COMPILE_ASSERT_MATCHING_ENUM(WebScreenOrientationPortraitSecondary, WebScreenOri entationLockPortraitSecondary); 23 STATIC_ASSERT_MATCHING_ENUM(WebScreenOrientationPortraitSecondary, WebScreenOrie ntationLockPortraitSecondary);
24 COMPILE_ASSERT_MATCHING_ENUM(WebScreenOrientationLandscapePrimary, WebScreenOrie ntationLockLandscapePrimary); 24 STATIC_ASSERT_MATCHING_ENUM(WebScreenOrientationLandscapePrimary, WebScreenOrien tationLockLandscapePrimary);
25 COMPILE_ASSERT_MATCHING_ENUM(WebScreenOrientationLandscapeSecondary, WebScreenOr ientationLockLandscapeSecondary); 25 STATIC_ASSERT_MATCHING_ENUM(WebScreenOrientationLandscapeSecondary, WebScreenOri entationLockLandscapeSecondary);
26 26
27 namespace blink { 27 namespace blink {
28 28
29 struct ScreenOrientationInfo { 29 struct ScreenOrientationInfo {
30 const AtomicString& name; 30 const AtomicString& name;
31 unsigned orientation; 31 unsigned orientation;
32 }; 32 };
33 33
34 static ScreenOrientationInfo* orientationsMap(unsigned& length) 34 static ScreenOrientationInfo* orientationsMap(unsigned& length)
35 { 35 {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 return ScreenOrientationController::from(*m_frame); 183 return ScreenOrientationController::from(*m_frame);
184 } 184 }
185 185
186 void ScreenOrientation::trace(Visitor* visitor) 186 void ScreenOrientation::trace(Visitor* visitor)
187 { 187 {
188 EventTargetWithInlineData::trace(visitor); 188 EventTargetWithInlineData::trace(visitor);
189 DOMWindowProperty::trace(visitor); 189 DOMWindowProperty::trace(visitor);
190 } 190 }
191 191
192 } // namespace blink 192 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698