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