diff options
author | Daniel Cheng <dcheng@chromium.org> | 2015-07-16 14:44:58 -0700 |
---|---|---|
committer | Daniel Cheng <dcheng@chromium.org> | 2015-07-16 21:46:05 +0000 |
commit | 9ce8be44d36f1d8e52a571a18def3b5295cf0763 (patch) | |
tree | dfa22b320df867eee76de0de7125bb0a811e4626 | |
parent | 9808175ad322e8387366cdec088e65ccb934ceac (diff) | |
download | chromium_src-9ce8be44d36f1d8e52a571a18def3b5295cf0763.zip chromium_src-9ce8be44d36f1d8e52a571a18def3b5295cf0763.tar.gz chromium_src-9ce8be44d36f1d8e52a571a18def3b5295cf0763.tar.bz2 |
Add IPC and Windows message map macro blocks to .clang-format options
Use the new MacroBlockBegin/MacroBlockEnd options introduced in
http://reviews.llvm.org/rL241363 so clang-format can correctly indent
the bodies of IPC message maps, etc.
BUG=373340
R=thakis@chromium.org
TBR=darin@chromium.org
Review URL: https://codereview.chromium.org/1225333004 .
Cr-Commit-Position: refs/heads/master@{#339131}
-rw-r--r-- | .clang-format | 21 | ||||
-rw-r--r-- | ipc/attachment_broker_messages.h | 6 |
2 files changed, 24 insertions, 3 deletions
diff --git a/.clang-format b/.clang-format index 6fdf1dc..27c1b2c 100644 --- a/.clang-format +++ b/.clang-format @@ -6,3 +6,24 @@ BasedOnStyle: Chromium # 'vector<vector<int>>'. ('Auto' means that clang-format will only use # 'int>>' if the file already contains at least one such instance.) Standard: Cpp11 +# Make sure code like: +# IPC_BEGIN_MESSAGE_MAP() +# IPC_MESSAGE_HANDLER(WidgetHostViewHost_Update, OnUpdate) +# IPC_END_MESSAGE_MAP() +# gets correctly indented. +MacroBlockBegin: "^\ +BEGIN_MSG_MAP|\ +BEGIN_MSG_MAP_EX|\ +BEGIN_SAFE_MSG_MAP_EX|\ +CR_BEGIN_MSG_MAP_EX|\ +IPC_BEGIN_MESSAGE_MAP|\ +IPC_BEGIN_MESSAGE_MAP_WITH_PARAM|\ +IPC_STRUCT_BEGIN|\ +IPC_STRUCT_BEGIN_WITH_PARENT|\ +IPC_STRUCT_TRAITS_BEGIN$" +MacroBlockEnd: "^\ +CR_END_MSG_MAP|\ +END_MSG_MAP|\ +IPC_END_MESSAGE_MAP|\ +IPC_STRUCT_END|\ +IPC_STRUCT_TRAITS_END$" diff --git a/ipc/attachment_broker_messages.h b/ipc/attachment_broker_messages.h index ee13681..eed2518 100644 --- a/ipc/attachment_broker_messages.h +++ b/ipc/attachment_broker_messages.h @@ -19,9 +19,9 @@ #if defined(OS_WIN) IPC_STRUCT_TRAITS_BEGIN(IPC::internal::HandleAttachmentWin::WireFormat) -IPC_STRUCT_TRAITS_MEMBER(handle) -IPC_STRUCT_TRAITS_MEMBER(destination_process) -IPC_STRUCT_TRAITS_MEMBER(attachment_id) + IPC_STRUCT_TRAITS_MEMBER(handle) + IPC_STRUCT_TRAITS_MEMBER(destination_process) + IPC_STRUCT_TRAITS_MEMBER(attachment_id) IPC_STRUCT_TRAITS_END() #endif // defined(OS_WIN) |