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 17 matching lines...) Expand all Loading... |
28 class DoNothingRequestDelegate : public HttpStreamRequest::Delegate { | 28 class DoNothingRequestDelegate : public HttpStreamRequest::Delegate { |
29 public: | 29 public: |
30 DoNothingRequestDelegate() {} | 30 DoNothingRequestDelegate() {} |
31 | 31 |
32 ~DoNothingRequestDelegate() override {} | 32 ~DoNothingRequestDelegate() override {} |
33 | 33 |
34 // HttpStreamRequest::Delegate | 34 // HttpStreamRequest::Delegate |
35 void OnStreamReady(const SSLConfig& used_ssl_config, | 35 void OnStreamReady(const SSLConfig& used_ssl_config, |
36 const ProxyInfo& used_proxy_info, | 36 const ProxyInfo& used_proxy_info, |
37 HttpStream* stream) override {} | 37 HttpStream* stream) override {} |
| 38 void OnBidirectionalStreamJobReady( |
| 39 const SSLConfig& used_ssl_config, |
| 40 const ProxyInfo& used_proxy_info, |
| 41 BidirectionalStreamJob* stream_job) override {} |
| 42 |
38 void OnWebSocketHandshakeStreamReady( | 43 void OnWebSocketHandshakeStreamReady( |
39 const SSLConfig& used_ssl_config, | 44 const SSLConfig& used_ssl_config, |
40 const ProxyInfo& used_proxy_info, | 45 const ProxyInfo& used_proxy_info, |
41 WebSocketHandshakeStreamBase* stream) override {} | 46 WebSocketHandshakeStreamBase* stream) override {} |
42 void OnStreamFailed(int status, | 47 void OnStreamFailed(int status, |
43 const SSLConfig& used_ssl_config, | 48 const SSLConfig& used_ssl_config, |
44 SSLFailureState ssl_failure_state) override {} | 49 SSLFailureState ssl_failure_state) override {} |
45 void OnCertificateError(int status, | 50 void OnCertificateError(int status, |
46 const SSLConfig& used_ssl_config, | 51 const SSLConfig& used_ssl_config, |
47 const SSLInfo& ssl_info) override {} | 52 const SSLInfo& ssl_info) override {} |
(...skipping 17 matching lines...) Expand all Loading... |
65 SpdySessionDependencies session_deps(GetParam(), | 70 SpdySessionDependencies session_deps(GetParam(), |
66 ProxyService::CreateDirect()); | 71 ProxyService::CreateDirect()); |
67 | 72 |
68 scoped_ptr<HttpNetworkSession> session = | 73 scoped_ptr<HttpNetworkSession> session = |
69 SpdySessionDependencies::SpdyCreateSession(&session_deps); | 74 SpdySessionDependencies::SpdyCreateSession(&session_deps); |
70 HttpStreamFactoryImpl* factory = | 75 HttpStreamFactoryImpl* factory = |
71 static_cast<HttpStreamFactoryImpl*>(session->http_stream_factory()); | 76 static_cast<HttpStreamFactoryImpl*>(session->http_stream_factory()); |
72 | 77 |
73 DoNothingRequestDelegate request_delegate; | 78 DoNothingRequestDelegate request_delegate; |
74 HttpStreamFactoryImpl::Request request( | 79 HttpStreamFactoryImpl::Request request( |
75 GURL(), factory, &request_delegate, NULL, BoundNetLog()); | 80 GURL(), factory, &request_delegate, NULL, BoundNetLog(), |
| 81 HttpStreamFactoryImpl::Request::HTTP_STREAM); |
76 | 82 |
77 HttpStreamFactoryImpl::Job* job = | 83 HttpStreamFactoryImpl::Job* job = |
78 new HttpStreamFactoryImpl::Job(factory, | 84 new HttpStreamFactoryImpl::Job(factory, |
79 session.get(), | 85 session.get(), |
80 HttpRequestInfo(), | 86 HttpRequestInfo(), |
81 DEFAULT_PRIORITY, | 87 DEFAULT_PRIORITY, |
82 SSLConfig(), | 88 SSLConfig(), |
83 SSLConfig(), | 89 SSLConfig(), |
84 NULL); | 90 NULL); |
85 request.AttachJob(job); | 91 request.AttachJob(job); |
86 EXPECT_EQ(DEFAULT_PRIORITY, job->priority()); | 92 EXPECT_EQ(DEFAULT_PRIORITY, job->priority()); |
87 | 93 |
88 request.SetPriority(MEDIUM); | 94 request.SetPriority(MEDIUM); |
89 EXPECT_EQ(MEDIUM, job->priority()); | 95 EXPECT_EQ(MEDIUM, job->priority()); |
90 | 96 |
91 // Make |job| the bound job. | 97 // Make |job| the bound job. |
92 request.OnStreamFailed(job, ERR_FAILED, SSLConfig(), SSL_FAILURE_NONE); | 98 request.OnStreamFailed(job, ERR_FAILED, SSLConfig(), SSL_FAILURE_NONE); |
93 | 99 |
94 request.SetPriority(IDLE); | 100 request.SetPriority(IDLE); |
95 EXPECT_EQ(IDLE, job->priority()); | 101 EXPECT_EQ(IDLE, job->priority()); |
96 } | 102 } |
97 | 103 |
98 } // namespace net | 104 } // namespace net |
OLD | NEW |