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 #import "ios/web/public/test/http_server/response_provider.h" | 5 #import "ios/web/public/test/http_server/response_provider.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "net/http/http_response_headers.h" | 8 #include "net/http/http_response_headers.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 ResponseProvider::Request::Request(const GURL& url, | 16 ResponseProvider::Request::Request(const GURL& url, |
13 const std::string& method, | 17 const std::string& method, |
14 const std::string& body, | 18 const std::string& body, |
15 const net::HttpRequestHeaders& headers) | 19 const net::HttpRequestHeaders& headers) |
16 : url(url), method(method), body(body), headers(headers) {} | 20 : url(url), method(method), body(body), headers(headers) {} |
17 | 21 |
18 ResponseProvider::Request::Request(const Request& other) = default; | 22 ResponseProvider::Request::Request(const Request& other) = default; |
19 | 23 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 ResponseProvider::GetRedirectResponseHeaders( | 75 ResponseProvider::GetRedirectResponseHeaders( |
72 const std::string& destination, | 76 const std::string& destination, |
73 const net::HttpStatusCode& http_status) { | 77 const net::HttpStatusCode& http_status) { |
74 scoped_refptr<net::HttpResponseHeaders> headers( | 78 scoped_refptr<net::HttpResponseHeaders> headers( |
75 GetResponseHeaders("text/html", http_status)); | 79 GetResponseHeaders("text/html", http_status)); |
76 headers->AddHeader("Location: " + destination); | 80 headers->AddHeader("Location: " + destination); |
77 return headers; | 81 return headers; |
78 } | 82 } |
79 | 83 |
80 } // namespace web | 84 } // namespace web |
OLD | NEW |