| 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 "net/test/url_request/url_request_mock_data_job.h" | 5 #include "net/test/url_request/url_request_mock_data_job.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 void URLRequestMockDataJob::AddUrlHandler() { | 176 void URLRequestMockDataJob::AddUrlHandler() { |
| 177 return AddUrlHandlerForHostname(kMockHostname); | 177 return AddUrlHandlerForHostname(kMockHostname); |
| 178 } | 178 } |
| 179 | 179 |
| 180 // static | 180 // static |
| 181 void URLRequestMockDataJob::AddUrlHandlerForHostname( | 181 void URLRequestMockDataJob::AddUrlHandlerForHostname( |
| 182 const std::string& hostname) { | 182 const std::string& hostname) { |
| 183 // Add |hostname| to URLRequestFilter for HTTP and HTTPS. | 183 // Add |hostname| to URLRequestFilter for HTTP and HTTPS. |
| 184 URLRequestFilter* filter = URLRequestFilter::GetInstance(); | 184 URLRequestFilter* filter = URLRequestFilter::GetInstance(); |
| 185 filter->AddHostnameInterceptor("http", hostname, | 185 filter->AddHostnameInterceptor("http", hostname, |
| 186 base::WrapUnique(new MockJobInterceptor())); | 186 base::MakeUnique<MockJobInterceptor>()); |
| 187 filter->AddHostnameInterceptor("https", hostname, | 187 filter->AddHostnameInterceptor("https", hostname, |
| 188 base::WrapUnique(new MockJobInterceptor())); | 188 base::MakeUnique<MockJobInterceptor>()); |
| 189 } | 189 } |
| 190 | 190 |
| 191 // static | 191 // static |
| 192 GURL URLRequestMockDataJob::GetMockHttpUrl(const std::string& data, | 192 GURL URLRequestMockDataJob::GetMockHttpUrl(const std::string& data, |
| 193 int repeat_count) { | 193 int repeat_count) { |
| 194 return GetMockHttpUrlForHostname(kMockHostname, data, repeat_count); | 194 return GetMockHttpUrlForHostname(kMockHostname, data, repeat_count); |
| 195 } | 195 } |
| 196 | 196 |
| 197 // static | 197 // static |
| 198 GURL URLRequestMockDataJob::GetMockHttpsUrl(const std::string& data, | 198 GURL URLRequestMockDataJob::GetMockHttpsUrl(const std::string& data, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 214 | 214 |
| 215 // static | 215 // static |
| 216 GURL URLRequestMockDataJob::GetMockHttpsUrlForHostname( | 216 GURL URLRequestMockDataJob::GetMockHttpsUrlForHostname( |
| 217 const std::string& hostname, | 217 const std::string& hostname, |
| 218 const std::string& data, | 218 const std::string& data, |
| 219 int repeat_count) { | 219 int repeat_count) { |
| 220 return GetMockUrl("https", hostname, data, repeat_count, false); | 220 return GetMockUrl("https", hostname, data, repeat_count, false); |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace net | 223 } // namespace net |
| OLD | NEW |