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 } // namespace content |
OLD | NEW |