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

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

Issue 1320683003: Move logic to figure out if a socket can be reused into HttpStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 3 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 <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 13331 matching lines...) Expand 10 before | Expand all | Expand 10 after
13342 return ERR_UNEXPECTED; 13342 return ERR_UNEXPECTED;
13343 } 13343 }
13344 13344
13345 void Close(bool not_reusable) override {} 13345 void Close(bool not_reusable) override {}
13346 13346
13347 bool IsResponseBodyComplete() const override { 13347 bool IsResponseBodyComplete() const override {
13348 ADD_FAILURE(); 13348 ADD_FAILURE();
13349 return false; 13349 return false;
13350 } 13350 }
13351 13351
13352 bool CanFindEndOfResponse() const override { return false; }
13353
13354 bool IsConnectionReused() const override { 13352 bool IsConnectionReused() const override {
13355 ADD_FAILURE(); 13353 ADD_FAILURE();
13356 return false; 13354 return false;
13357 } 13355 }
13358 13356
13359 void SetConnectionReused() override { ADD_FAILURE(); } 13357 void SetConnectionReused() override { ADD_FAILURE(); }
13360 13358
13361 bool IsConnectionReusable() const override { 13359 bool CanReuseConnection() const override { return false; }
13362 ADD_FAILURE();
13363 return false;
13364 }
13365 13360
13366 int64 GetTotalReceivedBytes() const override { 13361 int64 GetTotalReceivedBytes() const override {
13367 ADD_FAILURE(); 13362 ADD_FAILURE();
13368 return 0; 13363 return 0;
13369 } 13364 }
13370 13365
13371 bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override { 13366 bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override {
13372 ADD_FAILURE(); 13367 ADD_FAILURE();
13373 return false; 13368 return false;
13374 } 13369 }
13375 13370
13376 void GetSSLInfo(SSLInfo* ssl_info) override { ADD_FAILURE(); } 13371 void GetSSLInfo(SSLInfo* ssl_info) override { ADD_FAILURE(); }
13377 13372
13378 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override { 13373 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override {
13379 ADD_FAILURE(); 13374 ADD_FAILURE();
13380 } 13375 }
13381 13376
13382 bool IsSpdyHttpStream() const override {
13383 ADD_FAILURE();
13384 return false;
13385 }
13386
13387 void Drain(HttpNetworkSession* session) override { ADD_FAILURE(); } 13377 void Drain(HttpNetworkSession* session) override { ADD_FAILURE(); }
13388 13378
13389 void SetPriority(RequestPriority priority) override { priority_ = priority; } 13379 void SetPriority(RequestPriority priority) override { priority_ = priority; }
13390 13380
13391 UploadProgress GetUploadProgress() const override { return UploadProgress(); } 13381 UploadProgress GetUploadProgress() const override { return UploadProgress(); }
13392 13382
13393 HttpStream* RenewStreamForAuth() override { return NULL; } 13383 HttpStream* RenewStreamForAuth() override { return NULL; }
13394 13384
13395 private: 13385 private:
13396 RequestPriority priority_; 13386 RequestPriority priority_;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
13564 void Close(bool not_reusable) override { 13554 void Close(bool not_reusable) override {
13565 if (parser()) 13555 if (parser())
13566 parser()->Close(true); 13556 parser()->Close(true);
13567 } 13557 }
13568 13558
13569 bool IsResponseBodyComplete() const override { 13559 bool IsResponseBodyComplete() const override {
13570 NOTREACHED(); 13560 NOTREACHED();
13571 return false; 13561 return false;
13572 } 13562 }
13573 13563
13574 bool CanFindEndOfResponse() const override {
13575 return parser()->CanFindEndOfResponse();
13576 }
13577
13578 bool IsConnectionReused() const override { 13564 bool IsConnectionReused() const override {
13579 NOTREACHED(); 13565 NOTREACHED();
13580 return false; 13566 return false;
13581 } 13567 }
13582 void SetConnectionReused() override { NOTREACHED(); } 13568 void SetConnectionReused() override { NOTREACHED(); }
13583 13569
13584 bool IsConnectionReusable() const override { 13570 bool CanReuseConnection() const override { return false; }
13585 NOTREACHED();
13586 return false;
13587 }
13588 13571
13589 int64 GetTotalReceivedBytes() const override { 13572 int64 GetTotalReceivedBytes() const override {
13590 NOTREACHED(); 13573 NOTREACHED();
13591 return 0; 13574 return 0;
13592 } 13575 }
13593 13576
13594 bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override { 13577 bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const override {
13595 NOTREACHED(); 13578 NOTREACHED();
13596 return false; 13579 return false;
13597 } 13580 }
13598 13581
13599 void GetSSLInfo(SSLInfo* ssl_info) override {} 13582 void GetSSLInfo(SSLInfo* ssl_info) override {}
13600 13583
13601 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override { 13584 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override {
13602 NOTREACHED(); 13585 NOTREACHED();
13603 } 13586 }
13604 13587
13605 bool IsSpdyHttpStream() const override {
13606 NOTREACHED();
13607 return false;
13608 }
13609
13610 void Drain(HttpNetworkSession* session) override { NOTREACHED(); } 13588 void Drain(HttpNetworkSession* session) override { NOTREACHED(); }
13611 13589
13612 void SetPriority(RequestPriority priority) override { NOTREACHED(); } 13590 void SetPriority(RequestPriority priority) override { NOTREACHED(); }
13613 13591
13614 UploadProgress GetUploadProgress() const override { 13592 UploadProgress GetUploadProgress() const override {
13615 NOTREACHED(); 13593 NOTREACHED();
13616 return UploadProgress(); 13594 return UploadProgress();
13617 } 13595 }
13618 13596
13619 HttpStream* RenewStreamForAuth() override { 13597 HttpStream* RenewStreamForAuth() override {
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
14588 ASSERT_TRUE(response); 14566 ASSERT_TRUE(response);
14589 ASSERT_TRUE(response->headers.get()); 14567 ASSERT_TRUE(response->headers.get());
14590 14568
14591 EXPECT_EQ(101, response->headers->response_code()); 14569 EXPECT_EQ(101, response->headers->response_code());
14592 14570
14593 trans.reset(); 14571 trans.reset();
14594 session->CloseAllConnections(); 14572 session->CloseAllConnections();
14595 } 14573 }
14596 14574
14597 } // namespace net 14575 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698