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...) 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 RequestHandle* request, | 10957 scoped_ptr<Request>* 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 | |
10973 const std::vector<GURL>& resolved() const { return resolved_; } | 10966 const std::vector<GURL>& resolved() const { return resolved_; } |
10974 | 10967 |
10975 private: | 10968 private: |
10976 std::vector<GURL> resolved_; | 10969 std::vector<GURL> resolved_; |
10977 | 10970 |
10978 DISALLOW_COPY_AND_ASSIGN(CapturingProxyResolver); | 10971 DISALLOW_COPY_AND_ASSIGN(CapturingProxyResolver); |
10979 }; | 10972 }; |
10980 | 10973 |
10981 class CapturingProxyResolverFactory : public ProxyResolverFactory { | 10974 class CapturingProxyResolverFactory : public ProxyResolverFactory { |
10982 public: | 10975 public: |
(...skipping 4976 matching lines...) Loading... |
15959 base::MessageLoop::current()->RunUntilIdle(); | 15952 base::MessageLoop::current()->RunUntilIdle(); |
15960 | 15953 |
15961 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy); | 15954 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy); |
15962 HttpRequestHeaders headers; | 15955 HttpRequestHeaders headers; |
15963 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers)); | 15956 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers)); |
15964 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding)); | 15957 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding)); |
15965 } | 15958 } |
15966 #endif // !defined(OS_IOS) | 15959 #endif // !defined(OS_IOS) |
15967 | 15960 |
15968 } // namespace net | 15961 } // namespace net |
OLD | NEW |