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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 private: | 173 private: |
174 net::URLRequestContext* const request_context_; | 174 net::URLRequestContext* const request_context_; |
175 }; | 175 }; |
176 | 176 |
177 // This class forwards the incoming messages to the ResourceDispatcherHostTest. | 177 // This class forwards the incoming messages to the ResourceDispatcherHostTest. |
178 // This is used to emulate different sub-processes, since this filter will | 178 // This is used to emulate different sub-processes, since this filter will |
179 // have a different ID than the original. For the test, we want all the incoming | 179 // have a different ID than the original. For the test, we want all the incoming |
180 // messages to go to the same place, which is why this forwards. | 180 // messages to go to the same place, which is why this forwards. |
181 class ForwardingFilter : public ResourceMessageFilter { | 181 class ForwardingFilter : public ResourceMessageFilter { |
182 public: | 182 public: |
183 explicit ForwardingFilter(IPC::Sender* dest, | 183 ForwardingFilter(IPC::Sender* dest, |
184 ResourceContext* resource_context) | 184 ResourceContext* resource_context) |
185 : ResourceMessageFilter( | 185 : ResourceMessageFilter( |
186 ChildProcessHostImpl::GenerateChildProcessUniqueId(), | 186 ChildProcessHostImpl::GenerateChildProcessUniqueId(), |
187 PROCESS_TYPE_RENDERER, | 187 PROCESS_TYPE_RENDERER, |
188 resource_context, NULL, NULL, | 188 resource_context, NULL, NULL, |
189 new MockURLRequestContextSelector( | 189 new MockURLRequestContextSelector( |
190 resource_context->GetRequestContext())), | 190 resource_context->GetRequestContext())), |
191 dest_(dest) { | 191 dest_(dest) { |
192 OnChannelConnected(base::GetCurrentProcId()); | 192 OnChannelConnected(base::GetCurrentProcId()); |
193 } | 193 } |
194 | 194 |
(...skipping 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1954 } | 1954 } |
1955 | 1955 |
1956 MessageLoop::current()->RunUntilIdle(); | 1956 MessageLoop::current()->RunUntilIdle(); |
1957 | 1957 |
1958 msgs.clear(); | 1958 msgs.clear(); |
1959 accum_.GetClassifiedMessages(&msgs); | 1959 accum_.GetClassifiedMessages(&msgs); |
1960 } | 1960 } |
1961 } | 1961 } |
1962 | 1962 |
1963 } // namespace content | 1963 } // namespace content |
OLD | NEW |