OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_BROWSER_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_MESSAGE_FILTER_H_ |
6 #define CONTENT_BROWSER_BROWSER_MESSAGE_FILTER_H_ | 6 #define CONTENT_BROWSER_BROWSER_MESSAGE_FILTER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/process.h" | 9 #include "base/process.h" |
10 #include "content/browser/browser_thread.h" | 10 #include "content/browser/browser_thread.h" |
| 11 #include "content/common/content_export.h" |
11 #include "ipc/ipc_channel_proxy.h" | 12 #include "ipc/ipc_channel_proxy.h" |
12 | 13 |
13 // Base class for message filters in the browser process. You can receive and | 14 // Base class for message filters in the browser process. You can receive and |
14 // send messages on any thread. | 15 // send messages on any thread. |
15 class BrowserMessageFilter : public IPC::ChannelProxy::MessageFilter, | 16 class CONTENT_EXPORT BrowserMessageFilter : |
16 public IPC::Message::Sender { | 17 public IPC::ChannelProxy::MessageFilter, |
| 18 public IPC::Message::Sender { |
17 public: | 19 public: |
18 BrowserMessageFilter(); | 20 BrowserMessageFilter(); |
19 virtual ~BrowserMessageFilter(); | 21 virtual ~BrowserMessageFilter(); |
20 | 22 |
21 // IPC::ChannelProxy::MessageFilter methods. If you override them, make sure | 23 // IPC::ChannelProxy::MessageFilter methods. If you override them, make sure |
22 // to call them as well. These are always called on the IO thread. | 24 // to call them as well. These are always called on the IO thread. |
23 virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; | 25 virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; |
24 virtual void OnChannelClosing() OVERRIDE; | 26 virtual void OnChannelClosing() OVERRIDE; |
25 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 27 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
26 // DON'T OVERRIDE THIS! Override the other version below. | 28 // DON'T OVERRIDE THIS! Override the other version below. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 62 |
61 private: | 63 private: |
62 // Dispatches a message to the derived class. | 64 // Dispatches a message to the derived class. |
63 bool DispatchMessage(const IPC::Message& message); | 65 bool DispatchMessage(const IPC::Message& message); |
64 | 66 |
65 IPC::Channel* channel_; | 67 IPC::Channel* channel_; |
66 base::ProcessHandle peer_handle_; | 68 base::ProcessHandle peer_handle_; |
67 }; | 69 }; |
68 | 70 |
69 #endif // CONTENT_BROWSER_BROWSER_MESSAGE_FILTER_H_ | 71 #endif // CONTENT_BROWSER_BROWSER_MESSAGE_FILTER_H_ |
OLD | NEW |