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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 : resource_context_(&test_url_request_context_), | 123 : resource_context_(&test_url_request_context_), |
124 request_(url, | 124 request_(url, |
125 net::DEFAULT_PRIORITY, | 125 net::DEFAULT_PRIORITY, |
126 NULL, | 126 NULL, |
127 resource_context_.GetRequestContext()) { | 127 resource_context_.GetRequestContext()) { |
128 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 128 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
129 if (render_process_id != MSG_ROUTING_NONE && | 129 if (render_process_id != MSG_ROUTING_NONE && |
130 render_frame_id != MSG_ROUTING_NONE) { | 130 render_frame_id != MSG_ROUTING_NONE) { |
131 content::ResourceRequestInfo::AllocateForTesting( | 131 content::ResourceRequestInfo::AllocateForTesting( |
132 &request_, | 132 &request_, |
133 ResourceType::MAIN_FRAME, | 133 content::RESOURCE_TYPE_MAIN_FRAME, |
134 &resource_context_, | 134 &resource_context_, |
135 render_process_id, | 135 render_process_id, |
136 MSG_ROUTING_NONE, | 136 MSG_ROUTING_NONE, |
137 render_frame_id, | 137 render_frame_id, |
138 false); | 138 false); |
139 } | 139 } |
140 throttle_.reset(new InterceptNavigationResourceThrottle( | 140 throttle_.reset(new InterceptNavigationResourceThrottle( |
141 &request_, | 141 &request_, |
142 base::Bind(&MockInterceptCallbackReceiver::ShouldIgnoreNavigation, | 142 base::Bind(&MockInterceptCallbackReceiver::ShouldIgnoreNavigation, |
143 base::Unretained(callback_receiver)))); | 143 base::Unretained(callback_receiver)))); |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 REDIRECT_MODE_302, | 471 REDIRECT_MODE_302, |
472 web_contents()->GetRenderViewHost()->GetProcess()->GetID(), | 472 web_contents()->GetRenderViewHost()->GetProcess()->GetID(), |
473 web_contents()->GetMainFrame()->GetRoutingID(), | 473 web_contents()->GetMainFrame()->GetRoutingID(), |
474 base::Unretained(&defer))); | 474 base::Unretained(&defer))); |
475 | 475 |
476 // Wait for the request to finish processing. | 476 // Wait for the request to finish processing. |
477 base::RunLoop().RunUntilIdle(); | 477 base::RunLoop().RunUntilIdle(); |
478 } | 478 } |
479 | 479 |
480 } // namespace navigation_interception | 480 } // namespace navigation_interception |
OLD | NEW |