| Index: net/http/http_transaction_unittest.h
|
| ===================================================================
|
| --- net/http/http_transaction_unittest.h (revision 8697)
|
| +++ net/http/http_transaction_unittest.h (working copy)
|
| @@ -149,7 +149,7 @@
|
| if (result <= 0) {
|
| DidFinish(result);
|
| } else {
|
| - content_.append(read_buf_, result);
|
| + content_.append(read_buf_->data(), result);
|
| Read();
|
| }
|
| }
|
| @@ -163,7 +163,8 @@
|
|
|
| void Read() {
|
| state_ = READING;
|
| - int result = trans_->Read(read_buf_, sizeof(read_buf_), this);
|
| + read_buf_ = new net::IOBuffer(1024);
|
| + int result = trans_->Read(read_buf_, 1024, this);
|
| if (result != net::ERR_IO_PENDING)
|
| DidRead(result);
|
| }
|
| @@ -177,7 +178,7 @@
|
|
|
| scoped_ptr<net::HttpTransaction> trans_;
|
| std::string content_;
|
| - char read_buf_[1024];
|
| + scoped_refptr<net::IOBuffer> read_buf_;
|
| int error_;
|
|
|
| static int quit_counter_;
|
| @@ -237,11 +238,12 @@
|
| return net::ERR_FAILED;
|
| }
|
|
|
| - virtual int Read(char* buf, int buf_len, net::CompletionCallback* callback) {
|
| + virtual int Read(net::IOBuffer* buf, int buf_len,
|
| + net::CompletionCallback* callback) {
|
| int data_len = static_cast<int>(data_.size());
|
| int num = std::min(buf_len, data_len - data_cursor_);
|
| if (num) {
|
| - memcpy(buf, data_.data() + data_cursor_, num);
|
| + memcpy(buf->data(), data_.data() + data_cursor_, num);
|
| data_cursor_ += num;
|
| }
|
| if (test_mode_ & TEST_MODE_SYNC_NET_READ)
|
|
|