OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/process/process.h" | 9 #include "base/process/process.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 virtual void OnChannelClosing() {} | 44 virtual void OnChannelClosing() {} |
45 virtual void OnChannelConnected(int32 peer_pid) {} | 45 virtual void OnChannelConnected(int32 peer_pid) {} |
46 | 46 |
47 // Called when the message filter is about to be deleted. This gives | 47 // Called when the message filter is about to be deleted. This gives |
48 // derived classes the option of controlling which thread they're deleted | 48 // derived classes the option of controlling which thread they're deleted |
49 // on etc. | 49 // on etc. |
50 virtual void OnDestruct() const; | 50 virtual void OnDestruct() const; |
51 | 51 |
52 // IPC::Sender implementation. Can be called on any thread. Can't send sync | 52 // IPC::Sender implementation. Can be called on any thread. Can't send sync |
53 // messages (since we don't want to block the browser on any other process). | 53 // messages (since we don't want to block the browser on any other process). |
54 virtual bool Send(IPC::Message* message) OVERRIDE; | 54 virtual bool Send(IPC::Message* message) override; |
55 | 55 |
56 // If you want the given message to be dispatched to your OnMessageReceived on | 56 // If you want the given message to be dispatched to your OnMessageReceived on |
57 // a different thread, there are two options, either | 57 // a different thread, there are two options, either |
58 // OverrideThreadForMessage or OverrideTaskRunnerForMessage. | 58 // OverrideThreadForMessage or OverrideTaskRunnerForMessage. |
59 // If neither is overriden, the message will be dispatched on the IO thread. | 59 // If neither is overriden, the message will be dispatched on the IO thread. |
60 | 60 |
61 // If you want the message to be dispatched on a particular well-known | 61 // If you want the message to be dispatched on a particular well-known |
62 // browser thread, change |thread| to the id of the target thread | 62 // browser thread, change |thread| to the id of the target thread |
63 virtual void OverrideThreadForMessage( | 63 virtual void OverrideThreadForMessage( |
64 const IPC::Message& message, | 64 const IPC::Message& message, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 136 |
137 struct BrowserMessageFilterTraits { | 137 struct BrowserMessageFilterTraits { |
138 static void Destruct(const BrowserMessageFilter* filter) { | 138 static void Destruct(const BrowserMessageFilter* filter) { |
139 filter->OnDestruct(); | 139 filter->OnDestruct(); |
140 } | 140 } |
141 }; | 141 }; |
142 | 142 |
143 } // namespace content | 143 } // namespace content |
144 | 144 |
145 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_ | 145 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_ |
OLD | NEW |