| 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/common/content_export.h" | 10 #include "content/common/content_export.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // 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. |
| 25 virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; | 25 virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; |
| 26 virtual void OnChannelClosing() OVERRIDE; | 26 virtual void OnChannelClosing() OVERRIDE; |
| 27 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 27 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
| 28 // DON'T OVERRIDE THIS! Override the other version below. | 28 // DON'T OVERRIDE THIS! Override the other version below. |
| 29 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 29 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 30 | 30 |
| 31 // IPC::Message::Sender implementation. Can be called on any thread. Can't | 31 // IPC::Message::Sender implementation. Can be called on any thread. Can't |
| 32 // send sync messages (since we don't want to block the browser on any other | 32 // send sync messages (since we don't want to block the browser on any other |
| 33 // process). | 33 // process). |
| 34 virtual bool Send(IPC::Message* message); | 34 virtual bool Send(IPC::Message* message) OVERRIDE; |
| 35 | 35 |
| 36 // If you want the given message to be dispatched to your OnMessageReceived on | 36 // If you want the given message to be dispatched to your OnMessageReceived on |
| 37 // a different thread, change |thread| to the id of the target thread. | 37 // a different thread, change |thread| to the id of the target thread. |
| 38 // If you don't handle this message, or want to keep it on the IO thread, do | 38 // If you don't handle this message, or want to keep it on the IO thread, do |
| 39 // nothing. | 39 // nothing. |
| 40 virtual void OverrideThreadForMessage(const IPC::Message& message, | 40 virtual void OverrideThreadForMessage(const IPC::Message& message, |
| 41 content::BrowserThread::ID* thread); | 41 content::BrowserThread::ID* thread); |
| 42 | 42 |
| 43 // Override this to receive messages. | 43 // Override this to receive messages. |
| 44 // Your function will normally be called on the IO thread. However, if your | 44 // Your function will normally be called on the IO thread. However, if your |
| (...skipping 17 matching lines...) Expand all Loading... |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 // Dispatches a message to the derived class. | 64 // Dispatches a message to the derived class. |
| 65 bool DispatchMessage(const IPC::Message& message); | 65 bool DispatchMessage(const IPC::Message& message); |
| 66 | 66 |
| 67 IPC::Channel* channel_; | 67 IPC::Channel* channel_; |
| 68 base::ProcessHandle peer_handle_; | 68 base::ProcessHandle peer_handle_; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 #endif // CONTENT_BROWSER_BROWSER_MESSAGE_FILTER_H_ | 71 #endif // CONTENT_BROWSER_BROWSER_MESSAGE_FILTER_H_ |
| OLD | NEW |