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 "platform/testing/weburl_loader_mock.h" | 5 #include "platform/testing/weburl_loader_mock.h" |
6 | 6 |
7 #include "platform/testing/weburl_loader_mock_factory_impl.h" | 7 #include "platform/testing/weburl_loader_mock_factory_impl.h" |
8 #include "public/platform/URLConversion.h" | 8 #include "public/platform/URLConversion.h" |
9 #include "public/platform/WebData.h" | 9 #include "public/platform/WebData.h" |
10 #include "public/platform/WebURLError.h" | 10 #include "public/platform/WebURLError.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 newRequest.setFrameType(request.getFrameType()); | 75 newRequest.setFrameType(request.getFrameType()); |
76 newRequest.setSkipServiceWorker(request.skipServiceWorker()); | 76 newRequest.setSkipServiceWorker(request.skipServiceWorker()); |
77 newRequest.setShouldResetAppCache(request.shouldResetAppCache()); | 77 newRequest.setShouldResetAppCache(request.shouldResetAppCache()); |
78 newRequest.setFetchRequestMode(request.getFetchRequestMode()); | 78 newRequest.setFetchRequestMode(request.getFetchRequestMode()); |
79 newRequest.setFetchCredentialsMode(request.getFetchCredentialsMode()); | 79 newRequest.setFetchCredentialsMode(request.getFetchCredentialsMode()); |
80 newRequest.setHTTPMethod(request.httpMethod()); | 80 newRequest.setHTTPMethod(request.httpMethod()); |
81 newRequest.setHTTPBody(request.httpBody()); | 81 newRequest.setHTTPBody(request.httpBody()); |
82 | 82 |
83 WeakPtr<WebURLLoaderMock> self = weak_factory_.createWeakPtr(); | 83 WeakPtr<WebURLLoaderMock> self = weak_factory_.createWeakPtr(); |
84 | 84 |
85 client_->willFollowRedirect(this, newRequest, redirectResponse); | 85 client_->willFollowRedirect(this, newRequest, redirectResponse, |
| 86 kRedirectResponseOverheadBytes); |
86 | 87 |
87 // |this| might be deleted in willFollowRedirect(). | 88 // |this| might be deleted in willFollowRedirect(). |
88 if (!self) | 89 if (!self) |
89 return newRequest; | 90 return newRequest; |
90 | 91 |
91 if (redirectURL != KURL(newRequest.url())) { | 92 if (redirectURL != KURL(newRequest.url())) { |
92 // Only follow the redirect if WebKit left the URL unmodified. | 93 // Only follow the redirect if WebKit left the URL unmodified. |
93 // We assume that WebKit only changes the URL to suppress a redirect, and we | 94 // We assume that WebKit only changes the URL to suppress a redirect, and we |
94 // assume that it does so by setting it to be invalid. | 95 // assume that it does so by setting it to be invalid. |
95 DCHECK(!newRequest.url().isValid()); | 96 DCHECK(!newRequest.url().isValid()); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // In principle this is NOTIMPLEMENTED(), but if we put that here it floods | 158 // In principle this is NOTIMPLEMENTED(), but if we put that here it floods |
158 // the console during webkit unit tests, so we leave the function empty. | 159 // the console during webkit unit tests, so we leave the function empty. |
159 DCHECK(runner); | 160 DCHECK(runner); |
160 } | 161 } |
161 | 162 |
162 WeakPtr<WebURLLoaderMock> WebURLLoaderMock::GetWeakPtr() { | 163 WeakPtr<WebURLLoaderMock> WebURLLoaderMock::GetWeakPtr() { |
163 return weak_factory_.createWeakPtr(); | 164 return weak_factory_.createWeakPtr(); |
164 } | 165 } |
165 | 166 |
166 } // namespace blink | 167 } // namespace blink |
OLD | NEW |