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/browser/renderer_host/resource_dispatcher_host_impl.h" | 5 #include "content/browser/renderer_host/resource_dispatcher_host_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // This is used to emulate different sub-processes, since this filter will | 175 // This is used to emulate different sub-processes, since this filter will |
176 // have a different ID than the original. For the test, we want all the incoming | 176 // have a different ID than the original. For the test, we want all the incoming |
177 // messages to go to the same place, which is why this forwards. | 177 // messages to go to the same place, which is why this forwards. |
178 class ForwardingFilter : public ResourceMessageFilter { | 178 class ForwardingFilter : public ResourceMessageFilter { |
179 public: | 179 public: |
180 explicit ForwardingFilter(IPC::Sender* dest, | 180 explicit ForwardingFilter(IPC::Sender* dest, |
181 content::ResourceContext* resource_context) | 181 content::ResourceContext* resource_context) |
182 : ResourceMessageFilter( | 182 : ResourceMessageFilter( |
183 ChildProcessHostImpl::GenerateChildProcessUniqueId(), | 183 ChildProcessHostImpl::GenerateChildProcessUniqueId(), |
184 content::PROCESS_TYPE_RENDERER, | 184 content::PROCESS_TYPE_RENDERER, |
185 resource_context, | 185 resource_context, NULL, NULL, |
186 new MockURLRequestContextSelector( | 186 new MockURLRequestContextSelector( |
187 resource_context->GetRequestContext())), | 187 resource_context->GetRequestContext())), |
188 dest_(dest) { | 188 dest_(dest) { |
189 OnChannelConnected(base::GetCurrentProcId()); | 189 OnChannelConnected(base::GetCurrentProcId()); |
190 } | 190 } |
191 | 191 |
192 // ResourceMessageFilter override | 192 // ResourceMessageFilter override |
193 virtual bool Send(IPC::Message* msg) { | 193 virtual bool Send(IPC::Message* msg) { |
194 if (!dest_) | 194 if (!dest_) |
195 return false; | 195 return false; |
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1765 } | 1765 } |
1766 | 1766 |
1767 MessageLoop::current()->RunAllPending(); | 1767 MessageLoop::current()->RunAllPending(); |
1768 | 1768 |
1769 msgs.clear(); | 1769 msgs.clear(); |
1770 accum_.GetClassifiedMessages(&msgs); | 1770 accum_.GetClassifiedMessages(&msgs); |
1771 } | 1771 } |
1772 } | 1772 } |
1773 | 1773 |
1774 } // namespace content | 1774 } // namespace content |
OLD | NEW |