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

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

Issue 822713002: Update from https://crrev.com/309415 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years 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 <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 template<typename ParentPool> 509 template<typename ParentPool>
510 class CaptureGroupNameSocketPool : public ParentPool { 510 class CaptureGroupNameSocketPool : public ParentPool {
511 public: 511 public:
512 CaptureGroupNameSocketPool(HostResolver* host_resolver, 512 CaptureGroupNameSocketPool(HostResolver* host_resolver,
513 CertVerifier* cert_verifier); 513 CertVerifier* cert_verifier);
514 514
515 const std::string last_group_name_received() const { 515 const std::string last_group_name_received() const {
516 return last_group_name_; 516 return last_group_name_;
517 } 517 }
518 518
519 virtual int RequestSocket(const std::string& group_name, 519 int RequestSocket(const std::string& group_name,
520 const void* socket_params, 520 const void* socket_params,
521 RequestPriority priority, 521 RequestPriority priority,
522 ClientSocketHandle* handle, 522 ClientSocketHandle* handle,
523 const CompletionCallback& callback, 523 const CompletionCallback& callback,
524 const BoundNetLog& net_log) { 524 const BoundNetLog& net_log) override {
525 last_group_name_ = group_name; 525 last_group_name_ = group_name;
526 return ERR_IO_PENDING; 526 return ERR_IO_PENDING;
527 } 527 }
528 virtual void CancelRequest(const std::string& group_name, 528 void CancelRequest(const std::string& group_name,
529 ClientSocketHandle* handle) {} 529 ClientSocketHandle* handle) override {}
530 virtual void ReleaseSocket(const std::string& group_name, 530 void ReleaseSocket(const std::string& group_name,
531 scoped_ptr<StreamSocket> socket, 531 scoped_ptr<StreamSocket> socket,
532 int id) {} 532 int id) override {}
533 virtual void CloseIdleSockets() {} 533 void CloseIdleSockets() override {}
534 virtual int IdleSocketCount() const { 534 int IdleSocketCount() const override { return 0; }
535 int IdleSocketCountInGroup(const std::string& group_name) const override {
535 return 0; 536 return 0;
536 } 537 }
537 virtual int IdleSocketCountInGroup(const std::string& group_name) const { 538 LoadState GetLoadState(const std::string& group_name,
538 return 0; 539 const ClientSocketHandle* handle) const override {
539 }
540 virtual LoadState GetLoadState(const std::string& group_name,
541 const ClientSocketHandle* handle) const {
542 return LOAD_STATE_IDLE; 540 return LOAD_STATE_IDLE;
543 } 541 }
544 virtual base::TimeDelta ConnectionTimeout() const { 542 base::TimeDelta ConnectionTimeout() const override {
545 return base::TimeDelta(); 543 return base::TimeDelta();
546 } 544 }
547 545
548 private: 546 private:
549 std::string last_group_name_; 547 std::string last_group_name_;
550 }; 548 };
551 549
552 typedef CaptureGroupNameSocketPool<TransportClientSocketPool> 550 typedef CaptureGroupNameSocketPool<TransportClientSocketPool>
553 CaptureGroupNameTransportSocketPool; 551 CaptureGroupNameTransportSocketPool;
554 typedef CaptureGroupNameSocketPool<HttpProxyClientSocketPool> 552 typedef CaptureGroupNameSocketPool<HttpProxyClientSocketPool>
(...skipping 12632 matching lines...) Expand 10 before | Expand all | Expand 10 after
13187 EXPECT_EQ(ERR_IO_PENDING, rv); 13185 EXPECT_EQ(ERR_IO_PENDING, rv);
13188 13186
13189 rv = callback.WaitForResult(); 13187 rv = callback.WaitForResult();
13190 EXPECT_EQ(ERR_CONNECTION_RESET, rv); 13188 EXPECT_EQ(ERR_CONNECTION_RESET, rv);
13191 13189
13192 const HttpResponseInfo* response = trans->GetResponseInfo(); 13190 const HttpResponseInfo* response = trans->GetResponseInfo();
13193 EXPECT_TRUE(response == NULL); 13191 EXPECT_TRUE(response == NULL);
13194 } 13192 }
13195 13193
13196 } // namespace net 13194 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698