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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // return a non-null task runner which will target tasks accordingly. | 68 // return a non-null task runner which will target tasks accordingly. |
69 // Note: To target the UI thread, please use OverrideThreadForMessage | 69 // Note: To target the UI thread, please use OverrideThreadForMessage |
70 // since that has extra checks to avoid deadlocks. | 70 // since that has extra checks to avoid deadlocks. |
71 virtual base::TaskRunner* OverrideTaskRunnerForMessage( | 71 virtual base::TaskRunner* OverrideTaskRunnerForMessage( |
72 const IPC::Message& message); | 72 const IPC::Message& message); |
73 | 73 |
74 // Override this to receive messages. | 74 // Override this to receive messages. |
75 // Your function will normally be called on the IO thread. However, if your | 75 // Your function will normally be called on the IO thread. However, if your |
76 // OverrideXForMessage modifies the thread used to dispatch the message, | 76 // OverrideXForMessage modifies the thread used to dispatch the message, |
77 // your function will be called on the requested thread. | 77 // your function will be called on the requested thread. |
78 virtual bool OnMessageReceived(const IPC::Message& message, | 78 virtual bool OnMessageReceived(const IPC::Message& message) = 0; |
79 bool* message_was_ok) = 0; | |
80 | 79 |
81 // Can be called on any thread, after OnChannelConnected is called. | 80 // Can be called on any thread, after OnChannelConnected is called. |
82 base::ProcessHandle PeerHandle(); | 81 base::ProcessHandle PeerHandle(); |
83 | 82 |
84 // Can be called on any thread, after OnChannelConnected is called. | 83 // Can be called on any thread, after OnChannelConnected is called. |
85 base::ProcessId peer_pid() const { return peer_pid_; } | 84 base::ProcessId peer_pid() const { return peer_pid_; } |
86 | 85 |
87 void set_peer_pid_for_testing(base::ProcessId peer_pid) { | 86 void set_peer_pid_for_testing(base::ProcessId peer_pid) { |
88 peer_pid_ = peer_pid; | 87 peer_pid_ = peer_pid; |
89 } | 88 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 136 |
138 struct BrowserMessageFilterTraits { | 137 struct BrowserMessageFilterTraits { |
139 static void Destruct(const BrowserMessageFilter* filter) { | 138 static void Destruct(const BrowserMessageFilter* filter) { |
140 filter->OnDestruct(); | 139 filter->OnDestruct(); |
141 } | 140 } |
142 }; | 141 }; |
143 | 142 |
144 } // namespace content | 143 } // namespace content |
145 | 144 |
146 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_ | 145 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_MESSAGE_FILTER_H_ |
OLD | NEW |