OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
6 | 6 |
7 #include <math.h> // ceil | 7 #include <math.h> // ceil |
8 #include <stdarg.h> | 8 #include <stdarg.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <limits> | 10 #include <limits> |
(...skipping 10936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10947 } | 10947 } |
10948 | 10948 |
10949 class CapturingProxyResolver : public ProxyResolver { | 10949 class CapturingProxyResolver : public ProxyResolver { |
10950 public: | 10950 public: |
10951 CapturingProxyResolver() {} | 10951 CapturingProxyResolver() {} |
10952 ~CapturingProxyResolver() override {} | 10952 ~CapturingProxyResolver() override {} |
10953 | 10953 |
10954 int GetProxyForURL(const GURL& url, | 10954 int GetProxyForURL(const GURL& url, |
10955 ProxyInfo* results, | 10955 ProxyInfo* results, |
10956 const CompletionCallback& callback, | 10956 const CompletionCallback& callback, |
10957 scoped_ptr<Request>* request, | 10957 RequestHandle* request, |
10958 const BoundNetLog& net_log) override { | 10958 const BoundNetLog& net_log) override { |
10959 ProxyServer proxy_server(ProxyServer::SCHEME_HTTP, | 10959 ProxyServer proxy_server(ProxyServer::SCHEME_HTTP, |
10960 HostPortPair("myproxy", 80)); | 10960 HostPortPair("myproxy", 80)); |
10961 results->UseProxyServer(proxy_server); | 10961 results->UseProxyServer(proxy_server); |
10962 resolved_.push_back(url); | 10962 resolved_.push_back(url); |
10963 return OK; | 10963 return OK; |
10964 } | 10964 } |
10965 | 10965 |
| 10966 void CancelRequest(RequestHandle request) override { NOTREACHED(); } |
| 10967 |
| 10968 LoadState GetLoadState(RequestHandle request) const override { |
| 10969 NOTREACHED(); |
| 10970 return LOAD_STATE_IDLE; |
| 10971 } |
| 10972 |
10966 const std::vector<GURL>& resolved() const { return resolved_; } | 10973 const std::vector<GURL>& resolved() const { return resolved_; } |
10967 | 10974 |
10968 private: | 10975 private: |
10969 std::vector<GURL> resolved_; | 10976 std::vector<GURL> resolved_; |
10970 | 10977 |
10971 DISALLOW_COPY_AND_ASSIGN(CapturingProxyResolver); | 10978 DISALLOW_COPY_AND_ASSIGN(CapturingProxyResolver); |
10972 }; | 10979 }; |
10973 | 10980 |
10974 class CapturingProxyResolverFactory : public ProxyResolverFactory { | 10981 class CapturingProxyResolverFactory : public ProxyResolverFactory { |
10975 public: | 10982 public: |
(...skipping 4976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15952 base::MessageLoop::current()->RunUntilIdle(); | 15959 base::MessageLoop::current()->RunUntilIdle(); |
15953 | 15960 |
15954 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy); | 15961 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy); |
15955 HttpRequestHeaders headers; | 15962 HttpRequestHeaders headers; |
15956 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers)); | 15963 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers)); |
15957 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding)); | 15964 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding)); |
15958 } | 15965 } |
15959 #endif // !defined(OS_IOS) | 15966 #endif // !defined(OS_IOS) |
15960 | 15967 |
15961 } // namespace net | 15968 } // namespace net |
OLD | NEW |