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

Unified Diff: chrome/browser/browser_io_message_filter.h

Issue 5513001: Add a base class for objects that want to filter messages on the UI thread. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fix possible race condition 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
Index: chrome/browser/browser_io_message_filter.h
===================================================================
--- chrome/browser/browser_io_message_filter.h (revision 0)
+++ chrome/browser/browser_io_message_filter.h (revision 0)
@@ -0,0 +1,37 @@
+// Copyright (c) 2010 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.
+
+#ifndef CHROME_BROWSER_BROWSER_IO_MESSAGE_FILTER_H_
+#define CHROME_BROWSER_BROWSER_IO_MESSAGE_FILTER_H_
+#pragma once
+
+#include "base/process.h"
+#include "ipc/ipc_channel_proxy.h"
+
+// Base class for message filters in the browser process that reside on the IO
+// thread.
+class BrowserIOMessageFilter : public IPC::ChannelProxy::MessageFilter,
+ public IPC::Message::Sender {
+ public:
+ BrowserIOMessageFilter();
+ virtual ~BrowserIOMessageFilter();
+
+ // IPC::ChannelProxy::MessageFilter methods. If you override them, make sure
+ // to call them as well.
+ virtual void OnFilterAdded(IPC::Channel* channel);
+ virtual void OnChannelClosing();
+ virtual void OnChannelConnected(int32 peer_pid);
+
+ // IPC::Message::Sender implementation:
+ virtual bool Send(IPC::Message* msg);
+
+ protected:
+ base::ProcessHandle peer_handle() { return peer_handle_; }
+
+ private:
+ IPC::Channel* channel_;
+ base::ProcessHandle peer_handle_;
+};
+
+#endif // CHROME_BROWSER_BROWSER_IO_MESSAGE_FILTER_H_
Property changes on: chrome\browser\browser_io_message_filter.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698