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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 814673002: replace COMPILE_ASSERT with static_assert in web/ (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/web/WebInputEvent.cpp ('k') | Source/web/mac/WebScrollbarTheme.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 // Used to defer all page activity in cases where the embedder wishes to run 213 // Used to defer all page activity in cases where the embedder wishes to run
214 // a nested event loop. Using a stack enables nesting of message loop invocation s. 214 // a nested event loop. Using a stack enables nesting of message loop invocation s.
215 static WillBeHeapVector<RawPtrWillBeMember<ScopedPageLoadDeferrer> >& pageLoadDe ferrerStack() 215 static WillBeHeapVector<RawPtrWillBeMember<ScopedPageLoadDeferrer> >& pageLoadDe ferrerStack()
216 { 216 {
217 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WillBeHeapVector<RawPtrWillBeMemb er<ScopedPageLoadDeferrer> > >, deferrerStack, (adoptPtrWillBeNoop(new WillBeHea pVector<RawPtrWillBeMember<ScopedPageLoadDeferrer> > ()))); 217 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WillBeHeapVector<RawPtrWillBeMemb er<ScopedPageLoadDeferrer> > >, deferrerStack, (adoptPtrWillBeNoop(new WillBeHea pVector<RawPtrWillBeMember<ScopedPageLoadDeferrer> > ())));
218 return *deferrerStack; 218 return *deferrerStack;
219 } 219 }
220 220
221 // Ensure that the WebDragOperation enum values stay in sync with the original 221 // Ensure that the WebDragOperation enum values stay in sync with the original
222 // DragOperation constants. 222 // DragOperation constants.
223 #define COMPILE_ASSERT_MATCHING_ENUM(coreName) \ 223 #define STATIC_ASSERT_MATCHING_ENUM(coreName) \
224 COMPILE_ASSERT(int(coreName) == int(Web##coreName), dummy##coreName) 224 static_assert(int(coreName) == int(Web##coreName), "DragOperation and WebDra gOperation enum mismatch: " #coreName)
225 COMPILE_ASSERT_MATCHING_ENUM(DragOperationNone); 225 STATIC_ASSERT_MATCHING_ENUM(DragOperationNone);
226 COMPILE_ASSERT_MATCHING_ENUM(DragOperationCopy); 226 STATIC_ASSERT_MATCHING_ENUM(DragOperationCopy);
227 COMPILE_ASSERT_MATCHING_ENUM(DragOperationLink); 227 STATIC_ASSERT_MATCHING_ENUM(DragOperationLink);
228 COMPILE_ASSERT_MATCHING_ENUM(DragOperationGeneric); 228 STATIC_ASSERT_MATCHING_ENUM(DragOperationGeneric);
229 COMPILE_ASSERT_MATCHING_ENUM(DragOperationPrivate); 229 STATIC_ASSERT_MATCHING_ENUM(DragOperationPrivate);
230 COMPILE_ASSERT_MATCHING_ENUM(DragOperationMove); 230 STATIC_ASSERT_MATCHING_ENUM(DragOperationMove);
231 COMPILE_ASSERT_MATCHING_ENUM(DragOperationDelete); 231 STATIC_ASSERT_MATCHING_ENUM(DragOperationDelete);
232 COMPILE_ASSERT_MATCHING_ENUM(DragOperationEvery); 232 STATIC_ASSERT_MATCHING_ENUM(DragOperationEvery);
233 233
234 static bool shouldUseExternalPopupMenus = false; 234 static bool shouldUseExternalPopupMenus = false;
235 235
236 static int webInputEventKeyStateToPlatformEventKeyState(int webInputEventKeyStat e) 236 static int webInputEventKeyStateToPlatformEventKeyState(int webInputEventKeyStat e)
237 { 237 {
238 int platformEventKeyState = 0; 238 int platformEventKeyState = 0;
239 if (webInputEventKeyState & WebInputEvent::ShiftKey) 239 if (webInputEventKeyState & WebInputEvent::ShiftKey)
240 platformEventKeyState = platformEventKeyState | PlatformEvent::ShiftKey; 240 platformEventKeyState = platformEventKeyState | PlatformEvent::ShiftKey;
241 if (webInputEventKeyState & WebInputEvent::ControlKey) 241 if (webInputEventKeyState & WebInputEvent::ControlKey)
242 platformEventKeyState = platformEventKeyState | PlatformEvent::CtrlKey; 242 platformEventKeyState = platformEventKeyState | PlatformEvent::CtrlKey;
(...skipping 4260 matching lines...) Expand 10 before | Expand all | Expand 10 after
4503 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4503 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4504 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4504 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4505 } 4505 }
4506 4506
4507 void WebViewImpl::forceNextWebGLContextCreationToFail() 4507 void WebViewImpl::forceNextWebGLContextCreationToFail()
4508 { 4508 {
4509 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); 4509 WebGLRenderingContext::forceNextWebGLContextCreationToFail();
4510 } 4510 }
4511 4511
4512 } // namespace blink 4512 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebInputEvent.cpp ('k') | Source/web/mac/WebScrollbarTheme.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698