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 #include "content/public/browser/browser_message_filter.h" | 5 #include "content/public/browser/browser_message_filter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 runner->PostTask( | 60 runner->PostTask( |
61 FROM_HERE, | 61 FROM_HERE, |
62 base::Bind( | 62 base::Bind( |
63 base::IgnoreResult(&Internal::DispatchMessage), this, message)); | 63 base::IgnoreResult(&Internal::DispatchMessage), this, message)); |
64 return true; | 64 return true; |
65 } | 65 } |
66 return DispatchMessage(message); | 66 return DispatchMessage(message); |
67 } | 67 } |
68 | 68 |
69 if (thread == BrowserThread::UI && | 69 if (thread == BrowserThread::UI && |
70 !BrowserMessageFilter::CheckCanDispatchOnUI(message, filter_)) { | 70 !BrowserMessageFilter::CheckCanDispatchOnUI(message, filter_.get())) { |
71 return true; | 71 return true; |
72 } | 72 } |
73 | 73 |
74 BrowserThread::PostTask( | 74 BrowserThread::PostTask( |
75 thread, FROM_HERE, | 75 thread, FROM_HERE, |
76 base::Bind( | 76 base::Bind( |
77 base::IgnoreResult(&Internal::DispatchMessage), this, message)); | 77 base::IgnoreResult(&Internal::DispatchMessage), this, message)); |
78 return true; | 78 return true; |
79 } | 79 } |
80 | 80 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 218 |
219 IPC::MessageFilter* BrowserMessageFilter::GetFilter() { | 219 IPC::MessageFilter* BrowserMessageFilter::GetFilter() { |
220 // We create this on demand so that if a filter is used in a unit test but | 220 // We create this on demand so that if a filter is used in a unit test but |
221 // never attached to a channel, we don't leak Internal and this; | 221 // never attached to a channel, we don't leak Internal and this; |
222 DCHECK(!internal_) << "Should only be called once."; | 222 DCHECK(!internal_) << "Should only be called once."; |
223 internal_ = new Internal(this); | 223 internal_ = new Internal(this); |
224 return internal_; | 224 return internal_; |
225 } | 225 } |
226 | 226 |
227 } // namespace content | 227 } // namespace content |
OLD | NEW |