| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_response_body_drainer.h" | 5 #include "net/http/http_response_body_drainer.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include <cstring> | 9 #include <cstring> |
| 8 | 10 |
| 9 #include "base/bind.h" | 11 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 11 #include "base/location.h" | 13 #include "base/location.h" |
| 12 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 13 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 14 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
| 15 #include "base/thread_task_runner_handle.h" | 17 #include "base/thread_task_runner_handle.h" |
| 16 #include "net/base/io_buffer.h" | 18 #include "net/base/io_buffer.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 UploadProgress GetUploadProgress() const override { return UploadProgress(); } | 96 UploadProgress GetUploadProgress() const override { return UploadProgress(); } |
| 95 int ReadResponseHeaders(const CompletionCallback& callback) override { | 97 int ReadResponseHeaders(const CompletionCallback& callback) override { |
| 96 return ERR_UNEXPECTED; | 98 return ERR_UNEXPECTED; |
| 97 } | 99 } |
| 98 | 100 |
| 99 bool CanFindEndOfResponse() const override { return true; } | 101 bool CanFindEndOfResponse() const override { return true; } |
| 100 bool IsConnectionReused() const override { return false; } | 102 bool IsConnectionReused() const override { return false; } |
| 101 void SetConnectionReused() override {} | 103 void SetConnectionReused() override {} |
| 102 bool IsConnectionReusable() const override { return false; } | 104 bool IsConnectionReusable() const override { return false; } |
| 103 int64 GetTotalReceivedBytes() const override { return 0; } | 105 int64 GetTotalReceivedBytes() const override { return 0; } |
| 106 int64_t GetTotalSentBytes() const override { return 0; } |
| 104 void GetSSLInfo(SSLInfo* ssl_info) override {} | 107 void GetSSLInfo(SSLInfo* ssl_info) override {} |
| 105 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override {} | 108 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override {} |
| 106 | 109 |
| 107 // Mocked API | 110 // Mocked API |
| 108 int ReadResponseBody(IOBuffer* buf, | 111 int ReadResponseBody(IOBuffer* buf, |
| 109 int buf_len, | 112 int buf_len, |
| 110 const CompletionCallback& callback) override; | 113 const CompletionCallback& callback) override; |
| 111 void Close(bool not_reusable) override { | 114 void Close(bool not_reusable) override { |
| 112 CHECK(!closed_); | 115 CHECK(!closed_); |
| 113 closed_ = true; | 116 closed_ = true; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 too_many_chunks += 1; // Now it's too large. | 305 too_many_chunks += 1; // Now it's too large. |
| 303 | 306 |
| 304 mock_stream_->set_num_chunks(too_many_chunks); | 307 mock_stream_->set_num_chunks(too_many_chunks); |
| 305 drainer_->Start(session_.get()); | 308 drainer_->Start(session_.get()); |
| 306 EXPECT_TRUE(result_waiter_.WaitForResult()); | 309 EXPECT_TRUE(result_waiter_.WaitForResult()); |
| 307 } | 310 } |
| 308 | 311 |
| 309 } // namespace | 312 } // namespace |
| 310 | 313 |
| 311 } // namespace net | 314 } // namespace net |
| OLD | NEW |