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

Unified Diff: tools/ipc_fuzzer/message_lib/message_names.cc

Issue 105083002: IPC fuzzer: create message_lib library. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/ipc_fuzzer/message_lib/message_names.h ('k') | tools/ipc_fuzzer/replay/replay.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ipc_fuzzer/message_lib/message_names.cc
diff --git a/tools/ipc_fuzzer/message_lib/message_names.cc b/tools/ipc_fuzzer/message_lib/message_names.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b80b3881c000770c7e69a4757a79d256a29f70d6
--- /dev/null
+++ b/tools/ipc_fuzzer/message_lib/message_names.cc
@@ -0,0 +1,37 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "tools/ipc_fuzzer/message_lib/message_names.h"
+#include "tools/ipc_fuzzer/message_lib/all_messages.h"
+
+#include "ipc/ipc_message_null_macros.h"
+#undef IPC_MESSAGE_DECL
+#define IPC_MESSAGE_DECL(kind, type, name, in, out, ilist, olist) \
+ names.Add(static_cast<uint32>(name::ID), #name);
+
+void PopulateIpcMessageNames(ipc_fuzzer::MessageNames& names) {
+#include "tools/ipc_fuzzer/message_lib/all_messages.h"
+}
+
+namespace ipc_fuzzer {
+
+// static
+MessageNames* MessageNames::all_names_ = NULL;
+
+MessageNames::MessageNames() {
+}
+
+MessageNames::~MessageNames() {
+}
+
+// static
+MessageNames* MessageNames::GetInstance() {
+ if (!all_names_) {
+ all_names_ = new MessageNames();
+ PopulateIpcMessageNames(*all_names_);
+ }
+ return all_names_;
+}
+
+} // namespace ipc_fuzzer
« no previous file with comments | « tools/ipc_fuzzer/message_lib/message_names.h ('k') | tools/ipc_fuzzer/replay/replay.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698