Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: net/http/http_network_transaction_unittest.cc

Issue 2299963002: Reland "Change ProxyResolver::GetProxyForURL() to take a unique_ptr<Request>* " (Closed)
Patch Set: remove fields proposed by eroman Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10
(...skipping 11058 matching lines...) Expand 10 before | Expand all | Expand 10 after
11069 } 11069 }
11070 11070
11071 class CapturingProxyResolver : public ProxyResolver { 11071 class CapturingProxyResolver : public ProxyResolver {
11072 public: 11072 public:
11073 CapturingProxyResolver() {} 11073 CapturingProxyResolver() {}
11074 ~CapturingProxyResolver() override {} 11074 ~CapturingProxyResolver() override {}
11075 11075
11076 int GetProxyForURL(const GURL& url, 11076 int GetProxyForURL(const GURL& url,
11077 ProxyInfo* results, 11077 ProxyInfo* results,
11078 const CompletionCallback& callback, 11078 const CompletionCallback& callback,
11079 RequestHandle* request, 11079 std::unique_ptr<Request>* request,
11080 const NetLogWithSource& net_log) override { 11080 const NetLogWithSource& net_log) override {
11081 ProxyServer proxy_server(ProxyServer::SCHEME_HTTP, 11081 ProxyServer proxy_server(ProxyServer::SCHEME_HTTP,
11082 HostPortPair("myproxy", 80)); 11082 HostPortPair("myproxy", 80));
11083 results->UseProxyServer(proxy_server); 11083 results->UseProxyServer(proxy_server);
11084 resolved_.push_back(url); 11084 resolved_.push_back(url);
11085 return OK; 11085 return OK;
11086 } 11086 }
11087 11087
11088 void CancelRequest(RequestHandle request) override { NOTREACHED(); }
11089
11090 LoadState GetLoadState(RequestHandle request) const override {
11091 NOTREACHED();
11092 return LOAD_STATE_IDLE;
11093 }
11094
11095 const std::vector<GURL>& resolved() const { return resolved_; } 11088 const std::vector<GURL>& resolved() const { return resolved_; }
11096 11089
11097 private: 11090 private:
11098 std::vector<GURL> resolved_; 11091 std::vector<GURL> resolved_;
11099 11092
11100 DISALLOW_COPY_AND_ASSIGN(CapturingProxyResolver); 11093 DISALLOW_COPY_AND_ASSIGN(CapturingProxyResolver);
11101 }; 11094 };
11102 11095
11103 class CapturingProxyResolverFactory : public ProxyResolverFactory { 11096 class CapturingProxyResolverFactory : public ProxyResolverFactory {
11104 public: 11097 public:
(...skipping 4997 matching lines...) Expand 10 before | Expand all | Expand 10 after
16102 base::RunLoop().RunUntilIdle(); 16095 base::RunLoop().RunUntilIdle();
16103 16096
16104 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy); 16097 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy);
16105 HttpRequestHeaders headers; 16098 HttpRequestHeaders headers;
16106 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers)); 16099 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers));
16107 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding)); 16100 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding));
16108 } 16101 }
16109 #endif // !defined(OS_IOS) 16102 #endif // !defined(OS_IOS)
16110 16103
16111 } // namespace net 16104 } // namespace net
OLDNEW
« no previous file with comments | « content/browser/resolve_proxy_msg_helper_unittest.cc ('k') | net/http/http_stream_factory_impl_job_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698