| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #import "ios/web/public/test/http_server/data_response_provider.h" | 5 #import "ios/web/public/test/http_server/data_response_provider.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 | 9 |
| 10 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 11 #error "This file requires ARC support." |
| 12 #endif |
| 13 |
| 10 namespace web { | 14 namespace web { |
| 11 | 15 |
| 12 std::unique_ptr<net::test_server::HttpResponse> | 16 std::unique_ptr<net::test_server::HttpResponse> |
| 13 DataResponseProvider::GetEmbeddedTestServerResponse(const Request& request) { | 17 DataResponseProvider::GetEmbeddedTestServerResponse(const Request& request) { |
| 14 std::string response_body; | 18 std::string response_body; |
| 15 scoped_refptr<net::HttpResponseHeaders> response_headers; | 19 scoped_refptr<net::HttpResponseHeaders> response_headers; |
| 16 GetResponseHeadersAndBody(request, &response_headers, &response_body); | 20 GetResponseHeadersAndBody(request, &response_headers, &response_body); |
| 17 | 21 |
| 18 std::unique_ptr<net::test_server::BasicHttpResponse> data_response = | 22 std::unique_ptr<net::test_server::BasicHttpResponse> data_response = |
| 19 base::MakeUnique<net::test_server::BasicHttpResponse>(); | 23 base::MakeUnique<net::test_server::BasicHttpResponse>(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 31 if (name == "Content-type") { | 35 if (name == "Content-type") { |
| 32 data_response->set_content_type(value); | 36 data_response->set_content_type(value); |
| 33 continue; | 37 continue; |
| 34 } | 38 } |
| 35 data_response->AddCustomHeader(name, value); | 39 data_response->AddCustomHeader(name, value); |
| 36 } | 40 } |
| 37 return std::move(data_response); | 41 return std::move(data_response); |
| 38 } | 42 } |
| 39 | 43 |
| 40 } // namespace web | 44 } // namespace web |
| OLD | NEW |