OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_hanging_read_job.h" | 5 #include "net/test/url_request/url_request_hanging_read_job.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 void URLRequestHangingReadJob::StartAsync() { | 94 void URLRequestHangingReadJob::StartAsync() { |
95 set_expected_content_size(content_length_); | 95 set_expected_content_size(content_length_); |
96 NotifyHeadersComplete(); | 96 NotifyHeadersComplete(); |
97 } | 97 } |
98 | 98 |
99 // static | 99 // static |
100 void URLRequestHangingReadJob::AddUrlHandler() { | 100 void URLRequestHangingReadJob::AddUrlHandler() { |
101 // Add |hostname| to URLRequestFilter for HTTP and HTTPS. | 101 // Add |hostname| to URLRequestFilter for HTTP and HTTPS. |
102 URLRequestFilter* filter = URLRequestFilter::GetInstance(); | 102 URLRequestFilter* filter = URLRequestFilter::GetInstance(); |
103 filter->AddHostnameInterceptor("http", kMockHostname, | 103 filter->AddHostnameInterceptor("http", kMockHostname, |
104 base::WrapUnique(new MockJobInterceptor())); | 104 base::MakeUnique<MockJobInterceptor>()); |
105 filter->AddHostnameInterceptor("https", kMockHostname, | 105 filter->AddHostnameInterceptor("https", kMockHostname, |
106 base::WrapUnique(new MockJobInterceptor())); | 106 base::MakeUnique<MockJobInterceptor>()); |
107 } | 107 } |
108 | 108 |
109 // static | 109 // static |
110 GURL URLRequestHangingReadJob::GetMockHttpUrl() { | 110 GURL URLRequestHangingReadJob::GetMockHttpUrl() { |
111 return GetMockUrl("http", kMockHostname); | 111 return GetMockUrl("http", kMockHostname); |
112 } | 112 } |
113 | 113 |
114 // static | 114 // static |
115 GURL URLRequestHangingReadJob::GetMockHttpsUrl() { | 115 GURL URLRequestHangingReadJob::GetMockHttpsUrl() { |
116 return GetMockUrl("https", kMockHostname); | 116 return GetMockUrl("https", kMockHostname); |
117 } | 117 } |
118 | 118 |
119 } // namespace net | 119 } // namespace net |
OLD | NEW |