| 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/string_response_provider.h" | 5 #import "ios/web/public/test/http_server/string_response_provider.h" |
| 6 | 6 |
| 7 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 8 #error "This file requires ARC support." |
| 9 #endif |
| 10 |
| 7 namespace web { | 11 namespace web { |
| 8 | 12 |
| 9 StringResponseProvider::StringResponseProvider(const std::string& response_body) | 13 StringResponseProvider::StringResponseProvider(const std::string& response_body) |
| 10 : response_body_(response_body) {} | 14 : response_body_(response_body) {} |
| 11 | 15 |
| 12 bool StringResponseProvider::CanHandleRequest(const Request& request) { | 16 bool StringResponseProvider::CanHandleRequest(const Request& request) { |
| 13 return true; | 17 return true; |
| 14 } | 18 } |
| 15 | 19 |
| 16 void StringResponseProvider::GetResponseHeadersAndBody( | 20 void StringResponseProvider::GetResponseHeadersAndBody( |
| 17 const Request& request, | 21 const Request& request, |
| 18 scoped_refptr<net::HttpResponseHeaders>* headers, | 22 scoped_refptr<net::HttpResponseHeaders>* headers, |
| 19 std::string* response_body) { | 23 std::string* response_body) { |
| 20 *headers = GetDefaultResponseHeaders(); | 24 *headers = GetDefaultResponseHeaders(); |
| 21 *response_body = response_body_; | 25 *response_body = response_body_; |
| 22 } | 26 } |
| 23 | 27 |
| 24 } // namespace web | 28 } // namespace web |
| OLD | NEW |