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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 122 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
123 if (render_process_id != MSG_ROUTING_NONE && | 123 if (render_process_id != MSG_ROUTING_NONE && |
124 render_frame_id != MSG_ROUTING_NONE) { | 124 render_frame_id != MSG_ROUTING_NONE) { |
125 content::ResourceRequestInfo::AllocateForTesting( | 125 content::ResourceRequestInfo::AllocateForTesting( |
126 request_.get(), | 126 request_.get(), |
127 content::RESOURCE_TYPE_MAIN_FRAME, | 127 content::RESOURCE_TYPE_MAIN_FRAME, |
128 &resource_context_, | 128 &resource_context_, |
129 render_process_id, | 129 render_process_id, |
130 MSG_ROUTING_NONE, | 130 MSG_ROUTING_NONE, |
131 render_frame_id, | 131 render_frame_id, |
132 false); | 132 true, // is_main_frame |
| 133 false, // parent_is_main_frame |
| 134 false); // is_async |
133 } | 135 } |
134 throttle_.reset(new InterceptNavigationResourceThrottle( | 136 throttle_.reset(new InterceptNavigationResourceThrottle( |
135 request_.get(), | 137 request_.get(), |
136 base::Bind(&MockInterceptCallbackReceiver::ShouldIgnoreNavigation, | 138 base::Bind(&MockInterceptCallbackReceiver::ShouldIgnoreNavigation, |
137 base::Unretained(callback_receiver)))); | 139 base::Unretained(callback_receiver)))); |
138 throttle_->set_controller_for_testing(&throttle_controller_); | 140 throttle_->set_controller_for_testing(&throttle_controller_); |
139 request_->set_method(request_method); | 141 request_->set_method(request_method); |
140 | 142 |
141 if (redirect_mode == REDIRECT_MODE_302) { | 143 if (redirect_mode == REDIRECT_MODE_302) { |
142 net::HttpResponseInfo& response_info = | 144 net::HttpResponseInfo& response_info = |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 REDIRECT_MODE_302, | 465 REDIRECT_MODE_302, |
464 web_contents()->GetRenderViewHost()->GetProcess()->GetID(), | 466 web_contents()->GetRenderViewHost()->GetProcess()->GetID(), |
465 web_contents()->GetMainFrame()->GetRoutingID(), | 467 web_contents()->GetMainFrame()->GetRoutingID(), |
466 base::Unretained(&defer))); | 468 base::Unretained(&defer))); |
467 | 469 |
468 // Wait for the request to finish processing. | 470 // Wait for the request to finish processing. |
469 base::RunLoop().RunUntilIdle(); | 471 base::RunLoop().RunUntilIdle(); |
470 } | 472 } |
471 | 473 |
472 } // namespace navigation_interception | 474 } // namespace navigation_interception |
OLD | NEW |