OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_BROWSER_IO_MESSAGE_FILTER_H_ |
| 6 #define CHROME_BROWSER_BROWSER_IO_MESSAGE_FILTER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/process.h" |
| 10 #include "ipc/ipc_channel_proxy.h" |
| 11 |
| 12 // Base class for message filters in the browser process that reside on the IO |
| 13 // thread. |
| 14 class BrowserIOMessageFilter : public IPC::ChannelProxy::MessageFilter, |
| 15 public IPC::Message::Sender { |
| 16 public: |
| 17 BrowserIOMessageFilter(); |
| 18 virtual ~BrowserIOMessageFilter(); |
| 19 |
| 20 // IPC::ChannelProxy::MessageFilter methods. If you override them, make sure |
| 21 // to call them as well. |
| 22 virtual void OnFilterAdded(IPC::Channel* channel); |
| 23 virtual void OnChannelClosing(); |
| 24 virtual void OnChannelConnected(int32 peer_pid); |
| 25 |
| 26 // IPC::Message::Sender implementation: |
| 27 virtual bool Send(IPC::Message* msg); |
| 28 |
| 29 protected: |
| 30 base::ProcessHandle peer_handle() { return peer_handle_; } |
| 31 |
| 32 private: |
| 33 IPC::Channel* channel_; |
| 34 base::ProcessHandle peer_handle_; |
| 35 }; |
| 36 |
| 37 #endif // CHROME_BROWSER_BROWSER_IO_MESSAGE_FILTER_H_ |
OLD | NEW |