diff options
author | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-09 04:30:47 +0000 |
---|---|---|
committer | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-09 04:30:47 +0000 |
commit | 2984f1ca64a63ed179348f6a88133e06c117dd8b (patch) | |
tree | edf03eca1ece65cdfd845baa7771147166a0360b /chrome/common/ipc_logging.h | |
parent | efbbc4e910ffc6bfa364b6663143ac39930759fb (diff) | |
download | chromium_src-2984f1ca64a63ed179348f6a88133e06c117dd8b.zip chromium_src-2984f1ca64a63ed179348f6a88133e06c117dd8b.tar.gz chromium_src-2984f1ca64a63ed179348f6a88133e06c117dd8b.tar.bz2 |
Switch IPC classes over to using ObjectWatcher instead of MessageLoop::WatchObject.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@625 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_logging.h')
-rw-r--r-- | chrome/common/ipc_logging.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/chrome/common/ipc_logging.h b/chrome/common/ipc_logging.h index 7fa2be4..9173cd7 100644 --- a/chrome/common/ipc_logging.h +++ b/chrome/common/ipc_logging.h @@ -27,15 +27,18 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef CHROME_COMMON_IPC_LOGGING_H__ -#define CHROME_COMMON_IPC_LOGGING_H__ +#ifndef CHROME_COMMON_IPC_LOGGING_H_ +#define CHROME_COMMON_IPC_LOGGING_H_ #include "base/lock.h" -#include "base/message_loop.h" +#include "base/object_watcher.h" +#include "base/singleton.h" #include "chrome/common/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. #ifdef IPC_MESSAGE_LOG_ENABLED +class MessageLoop; + namespace IPC { class Message; @@ -43,8 +46,7 @@ class Message; // One instance per process. Needs to be created on the main thread (the UI // thread in the browser) but OnPreDispatchMessage/OnPostDispatchMessage // can be called on other threads. -class Logging : public base::RefCounted<Logging>, - public MessageLoop::Watcher { +class Logging : public base::ObjectWatcher::Delegate { public: // Implemented by consumers of log messages. class Consumer { @@ -85,10 +87,11 @@ class Logging : public base::RefCounted<Logging>, static void GetMessageText(uint16 type, std::wstring* name, const Message* message, std::wstring* params); - // MessageLoop::Watcher + // ObjectWatcher::Delegate implementation void OnObjectSignaled(HANDLE object); private: + friend struct DefaultSingletonTraits<IPC::Logging>; Logging(); std::wstring GetEventName(int browser_pid, bool enabled); @@ -97,6 +100,8 @@ class Logging : public base::RefCounted<Logging>, void RegisterWaitForEvent(bool enabled); + base::ObjectWatcher watcher_; + HANDLE logging_event_on_; HANDLE logging_event_off_; bool enabled_; @@ -108,14 +113,10 @@ class Logging : public base::RefCounted<Logging>, MessageLoop* main_thread_; Consumer* consumer_; - - static scoped_refptr<Logging> current_; - - static Lock logger_lock_; }; } // namespace IPC #endif // IPC_MESSAGE_LOG_ENABLED -#endif // CHROME_COMMON_IPC_LOGGING_H__ +#endif // CHROME_COMMON_IPC_LOGGING_H_ |