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

Unified Diff: chrome/common/ipc_logging.h

Issue 20015: Make it easier to create new IPC channel types (i.e. renderer/plugin). Inste... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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
« no previous file with comments | « chrome/common/ipc_fuzzing_tests.cc ('k') | chrome/common/ipc_logging.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/ipc_logging.h
===================================================================
--- chrome/common/ipc_logging.h (revision 9103)
+++ chrome/common/ipc_logging.h (working copy)
@@ -12,6 +12,7 @@
#include "base/lock.h"
#include "base/object_watcher.h"
#include "base/singleton.h"
+#include "chrome/common/ipc_message_utils.h"
class MessageLoop;
@@ -27,7 +28,7 @@
// Implemented by consumers of log messages.
class Consumer {
public:
- virtual void Log(const IPC::LogData& data) = 0;
+ virtual void Log(const LogData& data) = 0;
};
void SetConsumer(Consumer* consumer);
@@ -41,7 +42,7 @@
// Called by child processes to give the logger object the channel to send
// logging data to the browser process.
- void SetIPCSender(IPC::Message::Sender* sender);
+ void SetIPCSender(Message::Sender* sender);
// Called in the browser process when logging data from a child process is
// received.
@@ -66,8 +67,14 @@
// ObjectWatcher::Delegate implementation
void OnObjectSignaled(HANDLE object);
+ typedef void (LogFunction)(uint16 type,
+ std::wstring* name,
+ const Message* msg,
+ std::wstring* params);
+ void RegisterMessageLogger(int msg_start, LogFunction* func);
+
private:
- friend struct DefaultSingletonTraits<IPC::Logging>;
+ friend struct DefaultSingletonTraits<Logging>;
Logging();
std::wstring GetEventName(int browser_pid, bool enabled);
@@ -85,10 +92,12 @@
std::vector<LogData> queued_logs_;
bool queue_invoke_later_pending_;
- IPC::Message::Sender* sender_;
+ Message::Sender* sender_;
MessageLoop* main_thread_;
Consumer* consumer_;
+
+ LogFunction* log_function_mapping_[LastMsgIndex];
};
} // namespace IPC
« no previous file with comments | « chrome/common/ipc_fuzzing_tests.cc ('k') | chrome/common/ipc_logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698