| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 95 } |
| 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 IsConnectionReused() const override { return false; } | 101 bool IsConnectionReused() const override { return false; } |
| 100 void SetConnectionReused() override {} | 102 void SetConnectionReused() override {} |
| 101 bool CanReuseConnection() const override { return false; } | 103 bool CanReuseConnection() const override { return false; } |
| 102 int64 GetTotalReceivedBytes() const override { return 0; } | 104 int64 GetTotalReceivedBytes() const override { return 0; } |
| 105 int64_t GetTotalSentBytes() const override { return 0; } |
| 103 void GetSSLInfo(SSLInfo* ssl_info) override {} | 106 void GetSSLInfo(SSLInfo* ssl_info) override {} |
| 104 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override {} | 107 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override {} |
| 105 | 108 |
| 106 // Mocked API | 109 // Mocked API |
| 107 int ReadResponseBody(IOBuffer* buf, | 110 int ReadResponseBody(IOBuffer* buf, |
| 108 int buf_len, | 111 int buf_len, |
| 109 const CompletionCallback& callback) override; | 112 const CompletionCallback& callback) override; |
| 110 void Close(bool not_reusable) override { | 113 void Close(bool not_reusable) override { |
| 111 CHECK(!closed_); | 114 CHECK(!closed_); |
| 112 closed_ = true; | 115 closed_ = true; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 too_many_chunks += 1; // Now it's too large. | 302 too_many_chunks += 1; // Now it's too large. |
| 300 | 303 |
| 301 mock_stream_->set_num_chunks(too_many_chunks); | 304 mock_stream_->set_num_chunks(too_many_chunks); |
| 302 drainer_->Start(session_.get()); | 305 drainer_->Start(session_.get()); |
| 303 EXPECT_TRUE(result_waiter_.WaitForResult()); | 306 EXPECT_TRUE(result_waiter_.WaitForResult()); |
| 304 } | 307 } |
| 305 | 308 |
| 306 } // namespace | 309 } // namespace |
| 307 | 310 |
| 308 } // namespace net | 311 } // namespace net |
| OLD | NEW |