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

Unified Diff: chrome/test/ipclist/ipclist.cc

Issue 6646005: Creates the ipclist utility that chrome security team has wanted to dump... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« chrome/common/render_messages.h ('K') | « chrome/common/worker_messages.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ipclist/ipclist.cc
===================================================================
--- chrome/test/ipclist/ipclist.cc (revision 0)
+++ chrome/test/ipclist/ipclist.cc (revision 0)
@@ -0,0 +1,56 @@
+
jam 2011/03/09 06:33:45 nit: empty line
+#include <iostream>
+#include <string>
+
Paweł Hajdan Jr. 2011/03/09 15:56:41 I think you really want this file in chrome/tools.
+// Include once to get the type definitions
+#include "chrome/common/common_message_generator.h"
+
+struct msginfo {
+ const char* name;
+ int id;
+ int in_count;
+ int out_count;
+};
+
+// Redefine macros to generate table
+#include "ipc/ipc_message_null_macros.h"
+#undef IPC_MESSAGE_DECL
+#define IPC_MESSAGE_DECL(kind, type, name, in, out, ilist, olist) \
+ { #name, IPC_MESSAGE_ID(), in, out },
+
+static const struct msginfo msgtable[] = {
+#include "chrome/common/common_message_generator.h"
+};
+
+int main(int argc, char **argv) {
+ bool show_args = false;
+ bool show_ids = false;
+
+ while (--argc > 0) {
+ ++argv;
+ if (std::string("--args") == *argv)
jam 2011/03/09 06:33:45 nit: need brace brackets for if statement per guid
+ show_args = true;
+ else if (std::string("--ids") == *argv)
+ show_ids = true;
+ else {
+ std::cout << "usage: ipclist [--args] [--ids]" << std::endl;
+ return 1;
+ }
+ }
+
+ for (size_t i = 0; i < sizeof(msgtable)/sizeof(msgtable[0]); ++i) {
+ std::cout << msgtable[i].name;
+
+ if (show_args)
+ std::cout << "(" << msgtable[i].in_count << " IN, " <<
+ msgtable[i].out_count << " OUT)";
+
+ if (show_ids)
+ std::cout << " {" << IPC_MESSAGE_ID_CLASS(msgtable[i].id) << ", " <<
+ IPC_MESSAGE_ID_LINE(msgtable[i].id) << "}";
+
+ std::cout << std::endl;
+ }
+
+ return 0;
+}
Property changes on: chrome/test/ipclist/ipclist.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« chrome/common/render_messages.h ('K') | « chrome/common/worker_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698