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

Side by Side Diff: tools/ipc_fuzzer/message_lib/message_names.cc

Issue 1532053002: use variadic macros/templates in IPC message implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move for real Created 4 years, 10 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 | « tools/ipc_fuzzer/fuzzer/fuzzer.cc ('k') | tools/ipc_fuzzer/message_tools/message_list.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "tools/ipc_fuzzer/message_lib/message_names.h" 5 #include "tools/ipc_fuzzer/message_lib/message_names.h"
6 #include "tools/ipc_fuzzer/message_lib/all_messages.h" 6 #include "tools/ipc_fuzzer/message_lib/all_messages.h"
7 7
8 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" 8 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h"
9 #undef IPC_MESSAGE_DECL 9 #undef IPC_MESSAGE_DECL
10 #define IPC_MESSAGE_DECL(kind, type, name, in, out, ilist, olist) \ 10 #define IPC_MESSAGE_DECL(name, ...) \
11 names.Add(static_cast<uint32_t>(name::ID), #name); 11 names.Add(static_cast<uint32_t>(name::ID), #name);
12 12
13 void PopulateIpcMessageNames(ipc_fuzzer::MessageNames& names) { 13 void PopulateIpcMessageNames(ipc_fuzzer::MessageNames& names) {
14 #include "tools/ipc_fuzzer/message_lib/all_messages.h" 14 #include "tools/ipc_fuzzer/message_lib/all_messages.h"
15 } 15 }
16 16
17 namespace ipc_fuzzer { 17 namespace ipc_fuzzer {
18 18
19 // static 19 // static
20 MessageNames* MessageNames::all_names_ = NULL; 20 MessageNames* MessageNames::all_names_ = NULL;
21 21
22 MessageNames::MessageNames() { 22 MessageNames::MessageNames() {
23 } 23 }
24 24
25 MessageNames::~MessageNames() { 25 MessageNames::~MessageNames() {
26 } 26 }
27 27
28 // static 28 // static
29 MessageNames* MessageNames::GetInstance() { 29 MessageNames* MessageNames::GetInstance() {
30 if (!all_names_) { 30 if (!all_names_) {
31 all_names_ = new MessageNames(); 31 all_names_ = new MessageNames();
32 PopulateIpcMessageNames(*all_names_); 32 PopulateIpcMessageNames(*all_names_);
33 } 33 }
34 return all_names_; 34 return all_names_;
35 } 35 }
36 36
37 } // namespace ipc_fuzzer 37 } // namespace ipc_fuzzer
OLDNEW
« no previous file with comments | « tools/ipc_fuzzer/fuzzer/fuzzer.cc ('k') | tools/ipc_fuzzer/message_tools/message_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698