| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/web_url_loader_impl.h" | 5 #include "content/child/web_url_loader_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 ResourceDispatcher(nullptr, nullptr), | 61 ResourceDispatcher(nullptr, nullptr), |
| 62 canceled_(false), | 62 canceled_(false), |
| 63 defers_loading_(false) { | 63 defers_loading_(false) { |
| 64 } | 64 } |
| 65 | 65 |
| 66 ~TestResourceDispatcher() override {} | 66 ~TestResourceDispatcher() override {} |
| 67 | 67 |
| 68 // TestDispatcher implementation: | 68 // TestDispatcher implementation: |
| 69 | 69 |
| 70 int StartAsync(const RequestInfo& request_info, | 70 int StartAsync(const RequestInfo& request_info, |
| 71 ResourceRequestBody* request_body, | 71 ResourceRequestBodyImpl* request_body, |
| 72 std::unique_ptr<RequestPeer> peer) override { | 72 std::unique_ptr<RequestPeer> peer) override { |
| 73 EXPECT_FALSE(peer_); | 73 EXPECT_FALSE(peer_); |
| 74 peer_ = std::move(peer); | 74 peer_ = std::move(peer); |
| 75 url_ = request_info.url; | 75 url_ = request_info.url; |
| 76 stream_url_ = request_info.resource_body_stream_url; | 76 stream_url_ = request_info.resource_body_stream_url; |
| 77 return 1; | 77 return 1; |
| 78 } | 78 } |
| 79 | 79 |
| 80 void Cancel(int request_id) override { | 80 void Cancel(int request_id) override { |
| 81 EXPECT_FALSE(canceled_); | 81 EXPECT_FALSE(canceled_); |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 info.socket_address = net::HostPortPair(test.ip, 443); | 636 info.socket_address = net::HostPortPair(test.ip, 443); |
| 637 blink::WebURLResponse response; | 637 blink::WebURLResponse response; |
| 638 response.initialize(); | 638 response.initialize(); |
| 639 WebURLLoaderImpl::PopulateURLResponse(url, info, &response, true); | 639 WebURLLoaderImpl::PopulateURLResponse(url, info, &response, true); |
| 640 EXPECT_EQ(test.expected, response.remoteIPAddress().utf8()); | 640 EXPECT_EQ(test.expected, response.remoteIPAddress().utf8()); |
| 641 }; | 641 }; |
| 642 } | 642 } |
| 643 | 643 |
| 644 } // namespace | 644 } // namespace |
| 645 } // namespace content | 645 } // namespace content |
| OLD | NEW |