OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "android_webview/browser/net/aw_request_interceptor.h" | 5 #include "android_webview/browser/net/aw_request_interceptor.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "android_webview/browser/aw_contents_io_thread_client.h" | 9 #include "android_webview/browser/aw_contents_io_thread_client.h" |
10 #include "android_webview/browser/input_stream.h" | 10 #include "android_webview/browser/input_stream.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 if (!io_thread_client) | 167 if (!io_thread_client) |
168 return nullptr; | 168 return nullptr; |
169 | 169 |
170 GURL referrer(request->referrer()); | 170 GURL referrer(request->referrer()); |
171 if (referrer.is_valid() && | 171 if (referrer.is_valid() && |
172 (!request->is_pending() || request->is_redirecting())) { | 172 (!request->is_pending() || request->is_redirecting())) { |
173 request->SetExtraRequestHeaderByName(net::HttpRequestHeaders::kReferer, | 173 request->SetExtraRequestHeaderByName(net::HttpRequestHeaders::kReferer, |
174 referrer.spec(), true); | 174 referrer.spec(), true); |
175 } | 175 } |
176 request->SetUserData(kRequestAlreadyHasJobDataKey, | 176 request->SetUserData(kRequestAlreadyHasJobDataKey, |
177 new base::SupportsUserData::Data()); | 177 base::MakeUnique<base::SupportsUserData::Data>()); |
178 return new AndroidStreamReaderURLRequestJob( | 178 return new AndroidStreamReaderURLRequestJob( |
179 request, network_delegate, | 179 request, network_delegate, |
180 base::MakeUnique<ShouldInterceptRequestAdaptor>( | 180 base::MakeUnique<ShouldInterceptRequestAdaptor>( |
181 std::move(io_thread_client)), | 181 std::move(io_thread_client)), |
182 true); | 182 true); |
183 } | 183 } |
184 | 184 |
185 } // namespace android_webview | 185 } // namespace android_webview |
OLD | NEW |