| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_transaction_unittest.h" | 5 #include "net/http/http_transaction_unittest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 net::LoadState MockNetworkTransaction::GetLoadState() const { | 302 net::LoadState MockNetworkTransaction::GetLoadState() const { |
| 303 if (data_cursor_) | 303 if (data_cursor_) |
| 304 return net::LOAD_STATE_READING_RESPONSE; | 304 return net::LOAD_STATE_READING_RESPONSE; |
| 305 return net::LOAD_STATE_IDLE; | 305 return net::LOAD_STATE_IDLE; |
| 306 } | 306 } |
| 307 | 307 |
| 308 uint64 MockNetworkTransaction::GetUploadProgress() const { | 308 uint64 MockNetworkTransaction::GetUploadProgress() const { |
| 309 return 0; | 309 return 0; |
| 310 } | 310 } |
| 311 | 311 |
| 312 void MockNetworkTransaction::UpdateRankForExternalCacheHit() { |
| 313 } |
| 314 |
| 312 void MockNetworkTransaction::CallbackLater(net::CompletionCallback* callback, | 315 void MockNetworkTransaction::CallbackLater(net::CompletionCallback* callback, |
| 313 int result) { | 316 int result) { |
| 314 MessageLoop::current()->PostTask(FROM_HERE, task_factory_.NewRunnableMethod( | 317 MessageLoop::current()->PostTask(FROM_HERE, task_factory_.NewRunnableMethod( |
| 315 &MockNetworkTransaction::RunCallback, callback, result)); | 318 &MockNetworkTransaction::RunCallback, callback, result)); |
| 316 } | 319 } |
| 317 | 320 |
| 318 void MockNetworkTransaction::RunCallback(net::CompletionCallback* callback, | 321 void MockNetworkTransaction::RunCallback(net::CompletionCallback* callback, |
| 319 int result) { | 322 int result) { |
| 320 callback->Run(result); | 323 callback->Run(result); |
| 321 } | 324 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 if (rv > 0) { | 359 if (rv > 0) { |
| 357 content.append(buf->data(), rv); | 360 content.append(buf->data(), rv); |
| 358 } else if (rv < 0) { | 361 } else if (rv < 0) { |
| 359 return rv; | 362 return rv; |
| 360 } | 363 } |
| 361 } while (rv > 0); | 364 } while (rv > 0); |
| 362 | 365 |
| 363 result->swap(content); | 366 result->swap(content); |
| 364 return net::OK; | 367 return net::OK; |
| 365 } | 368 } |
| OLD | NEW |