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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "components/navigation_interception/intercept_navigation_resource_throt
tle.h" | 10 #include "components/navigation_interception/intercept_navigation_resource_throt
tle.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 TestIOThreadState(const GURL& url, | 111 TestIOThreadState(const GURL& url, |
112 int render_process_id, | 112 int render_process_id, |
113 int render_frame_id, | 113 int render_frame_id, |
114 const std::string& request_method, | 114 const std::string& request_method, |
115 RedirectMode redirect_mode, | 115 RedirectMode redirect_mode, |
116 MockInterceptCallbackReceiver* callback_receiver) | 116 MockInterceptCallbackReceiver* callback_receiver) |
117 : resource_context_(&test_url_request_context_), | 117 : resource_context_(&test_url_request_context_), |
118 request_(resource_context_.GetRequestContext()->CreateRequest( | 118 request_(resource_context_.GetRequestContext()->CreateRequest( |
119 url, | 119 url, |
120 net::DEFAULT_PRIORITY, | 120 net::DEFAULT_PRIORITY, |
121 NULL /* delegate */, | 121 NULL /* delegate */)) { |
122 NULL /* cookie_store */)) { | |
123 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 122 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
124 if (render_process_id != MSG_ROUTING_NONE && | 123 if (render_process_id != MSG_ROUTING_NONE && |
125 render_frame_id != MSG_ROUTING_NONE) { | 124 render_frame_id != MSG_ROUTING_NONE) { |
126 content::ResourceRequestInfo::AllocateForTesting( | 125 content::ResourceRequestInfo::AllocateForTesting( |
127 request_.get(), | 126 request_.get(), |
128 content::RESOURCE_TYPE_MAIN_FRAME, | 127 content::RESOURCE_TYPE_MAIN_FRAME, |
129 &resource_context_, | 128 &resource_context_, |
130 render_process_id, | 129 render_process_id, |
131 MSG_ROUTING_NONE, | 130 MSG_ROUTING_NONE, |
132 render_frame_id, | 131 render_frame_id, |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 REDIRECT_MODE_302, | 472 REDIRECT_MODE_302, |
474 web_contents()->GetRenderViewHost()->GetProcess()->GetID(), | 473 web_contents()->GetRenderViewHost()->GetProcess()->GetID(), |
475 web_contents()->GetMainFrame()->GetRoutingID(), | 474 web_contents()->GetMainFrame()->GetRoutingID(), |
476 base::Unretained(&defer))); | 475 base::Unretained(&defer))); |
477 | 476 |
478 // Wait for the request to finish processing. | 477 // Wait for the request to finish processing. |
479 base::RunLoop().RunUntilIdle(); | 478 base::RunLoop().RunUntilIdle(); |
480 } | 479 } |
481 | 480 |
482 } // namespace navigation_interception | 481 } // namespace navigation_interception |
OLD | NEW |