| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "net/http/http_stream_factory_impl_request.h" | 5 #include "net/http/http_stream_factory_impl_request.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "net/http/http_stream_factory_impl_job.h" | 8 #include "net/http/http_stream_factory_impl_job.h" |
| 9 #include "net/proxy/proxy_info.h" | 9 #include "net/proxy/proxy_info.h" |
| 10 #include "net/proxy/proxy_service.h" | 10 #include "net/proxy/proxy_service.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 scoped_ptr<HttpNetworkSession> session = | 73 scoped_ptr<HttpNetworkSession> session = |
| 74 SpdySessionDependencies::SpdyCreateSession(&session_deps); | 74 SpdySessionDependencies::SpdyCreateSession(&session_deps); |
| 75 HttpStreamFactoryImpl* factory = | 75 HttpStreamFactoryImpl* factory = |
| 76 static_cast<HttpStreamFactoryImpl*>(session->http_stream_factory()); | 76 static_cast<HttpStreamFactoryImpl*>(session->http_stream_factory()); |
| 77 | 77 |
| 78 DoNothingRequestDelegate request_delegate; | 78 DoNothingRequestDelegate request_delegate; |
| 79 HttpStreamFactoryImpl::Request request( | 79 HttpStreamFactoryImpl::Request request( |
| 80 GURL(), factory, &request_delegate, NULL, BoundNetLog(), | 80 GURL(), factory, &request_delegate, NULL, BoundNetLog(), |
| 81 HttpStreamFactoryImpl::Request::HTTP_STREAM); | 81 HttpStreamFactoryImpl::Request::HTTP_STREAM); |
| 82 | 82 |
| 83 HttpStreamFactoryImpl::Job* job = | 83 HttpRequestInfo request_info; |
| 84 new HttpStreamFactoryImpl::Job(factory, | 84 |
| 85 session.get(), | 85 HostPortPair server = HostPortPair::FromURL(request_info.url); |
| 86 HttpRequestInfo(), | 86 GURL original_url = factory->ApplyHostMappingRules(request_info.url, &server); |
| 87 DEFAULT_PRIORITY, | 87 |
| 88 SSLConfig(), | 88 HttpStreamFactoryImpl::Job* job = new HttpStreamFactoryImpl::Job( |
| 89 SSLConfig(), | 89 factory, session.get(), request_info, DEFAULT_PRIORITY, SSLConfig(), |
| 90 NULL); | 90 SSLConfig(), server, original_url, NULL); |
| 91 request.AttachJob(job); | 91 request.AttachJob(job); |
| 92 EXPECT_EQ(DEFAULT_PRIORITY, job->priority()); | 92 EXPECT_EQ(DEFAULT_PRIORITY, job->priority()); |
| 93 | 93 |
| 94 request.SetPriority(MEDIUM); | 94 request.SetPriority(MEDIUM); |
| 95 EXPECT_EQ(MEDIUM, job->priority()); | 95 EXPECT_EQ(MEDIUM, job->priority()); |
| 96 | 96 |
| 97 // Make |job| the bound job. | 97 // Make |job| the bound job. |
| 98 request.OnStreamFailed(job, ERR_FAILED, SSLConfig(), SSL_FAILURE_NONE); | 98 request.OnStreamFailed(job, ERR_FAILED, SSLConfig(), SSL_FAILURE_NONE); |
| 99 | 99 |
| 100 request.SetPriority(IDLE); | 100 request.SetPriority(IDLE); |
| 101 EXPECT_EQ(IDLE, job->priority()); | 101 EXPECT_EQ(IDLE, job->priority()); |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace net | 104 } // namespace net |
| OLD | NEW |