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

Unified Diff: ipc/ipc_logging.h

Issue 5526008: Simplify the magic required to create IPC message headers a bit. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | « ipc/ipc_fuzzing_tests.cc ('k') | ipc/ipc_logging.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_logging.h
===================================================================
--- ipc/ipc_logging.h (revision 68536)
+++ ipc/ipc_logging.h (working copy)
@@ -12,10 +12,19 @@
#include <vector>
+#include "base/hash_tables.h"
#include "base/message_loop.h"
#include "base/scoped_ptr.h"
#include "base/singleton.h"
+// Logging function. |name| is a string in ASCII and |params| is a string in
+// UTF-8.
+typedef void (*LogFunction)(std::string* name,
+ const IPC::Message* msg,
+ std::string* params);
+
+typedef base::hash_map<uint32, LogFunction > LogFunctionMap;
+
namespace IPC {
class Message;
@@ -71,14 +80,13 @@
static void GetMessageText(uint32 type, std::string* name,
const Message* message, std::string* params);
- // Logging function. |name| is a string in ASCII and |params| is a string in
- // UTF-8.
- typedef void (*LogFunction)(uint32 type,
- std::string* name,
- const Message* msg,
- std::string* params);
+ static void set_log_function_map(LogFunctionMap* functions) {
+ log_function_map_ = functions;
+ }
- static void SetLoggerFunctions(LogFunction *functions);
+ static LogFunctionMap* log_function_map() {
+ return log_function_map_;
+ }
private:
friend struct DefaultSingletonTraits<Logging>;
@@ -98,7 +106,7 @@
Consumer* consumer_;
- static LogFunction *log_function_mapping_;
+ static LogFunctionMap* log_function_map_;
};
} // namespace IPC
« no previous file with comments | « ipc/ipc_fuzzing_tests.cc ('k') | ipc/ipc_logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698