OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ios/web/net/request_tracker_impl.h" | 5 #include "ios/web/net/request_tracker_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); | 217 DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); |
218 tracker_->FinishPageLoad(url, false); | 218 tracker_->FinishPageLoad(url, false); |
219 receiver_.get()->value_ = 0.0f; | 219 receiver_.get()->value_ = 0.0f; |
220 receiver_.get()->max_ = 0.0f; | 220 receiver_.get()->max_ = 0.0f; |
221 loop_.RunUntilIdle(); | 221 loop_.RunUntilIdle(); |
222 } | 222 } |
223 | 223 |
224 net::TestJobInterceptor* AddInterceptorToRequest(size_t i) { | 224 net::TestJobInterceptor* AddInterceptorToRequest(size_t i) { |
225 // |interceptor| will be deleted from |job_factory_|'s destructor. | 225 // |interceptor| will be deleted from |job_factory_|'s destructor. |
226 net::TestJobInterceptor* protocol_handler = new net::TestJobInterceptor(); | 226 net::TestJobInterceptor* protocol_handler = new net::TestJobInterceptor(); |
227 job_factory_.SetProtocolHandler("http", protocol_handler); | 227 job_factory_.SetProtocolHandler("http", make_scoped_ptr(protocol_handler)); |
228 contexts_[i]->set_job_factory(&job_factory_); | 228 contexts_[i]->set_job_factory(&job_factory_); |
229 return protocol_handler; | 229 return protocol_handler; |
230 } | 230 } |
231 | 231 |
232 private: | 232 private: |
233 net::URLRequest* GetInternalRequest(size_t i, bool secure) { | 233 net::URLRequest* GetInternalRequest(size_t i, bool secure) { |
234 GURL url; | 234 GURL url; |
235 if (secure) | 235 if (secure) |
236 url = GetSecureURL(requests_.size()); | 236 url = GetSecureURL(requests_.size()); |
237 else | 237 else |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 base::Bind(&TwoStartsSSLCallback, | 489 base::Bind(&TwoStartsSSLCallback, |
490 &request_0_called)); | 490 &request_0_called)); |
491 tracker_->OnSSLCertificateError(GetSecureRequest(1), ssl_info, true, | 491 tracker_->OnSSLCertificateError(GetSecureRequest(1), ssl_info, true, |
492 base::Bind(&TwoStartsSSLCallback, | 492 base::Bind(&TwoStartsSSLCallback, |
493 &request_1_called)); | 493 &request_1_called)); |
494 EXPECT_TRUE(request_0_called); | 494 EXPECT_TRUE(request_0_called); |
495 EXPECT_TRUE(request_1_called); | 495 EXPECT_TRUE(request_1_called); |
496 } | 496 } |
497 | 497 |
498 } // namespace | 498 } // namespace |
OLD | NEW |