Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/browser/loader/mojo_async_resource_handler_test_util.h" | |
| 6 | |
| 7 namespace content { | |
| 8 | |
| 9 FakeURLLoaderClient::FakeURLLoaderClient() : binding_(this) {} | |
| 10 FakeURLLoaderClient::~FakeURLLoaderClient() {} | |
| 11 | |
| 12 void FakeURLLoaderClient::OnReceiveResponse( | |
| 13 const ResourceResponseHead& response_head) { | |
| 14 has_received_response_ = true; | |
| 15 response_head_ = response_head; | |
| 16 if (quit_closure_) | |
| 17 quit_closure_.Run(); | |
| 18 } | |
| 19 | |
| 20 void FakeURLLoaderClient::OnStartLoadingResponseBody( | |
| 21 mojo::ScopedDataPipeConsumerHandle body) { | |
| 22 response_body_ = std::move(body); | |
| 23 if (quit_closure_) | |
| 24 quit_closure_.Run(); | |
| 25 } | |
| 26 | |
| 27 void FakeURLLoaderClient::OnComplete( | |
| 28 const ResourceRequestCompletionStatus& status) { | |
| 29 has_received_completion_ = true; | |
| 30 completion_status_ = status; | |
| 31 if (quit_closure_) | |
| 32 quit_closure_.Run(); | |
| 33 } | |
| 34 | |
| 35 void FakeURLLoaderClient::Unbind() { | |
| 36 binding_.Unbind(); | |
| 37 response_body_ = mojo::ScopedDataPipeConsumerHandle(); | |
|
mmenke
2016/07/20 19:08:41
I think ".reset()" makes it much clearer that we'r
yhirano
2016/07/21 14:50:20
Done.
| |
| 38 } | |
| 39 | |
| 40 } // namespace content | |
| OLD | NEW |