| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 newRequest.setFrameType(request.getFrameType()); | 76 newRequest.setFrameType(request.getFrameType()); |
| 77 newRequest.setSkipServiceWorker(request.skipServiceWorker()); | 77 newRequest.setSkipServiceWorker(request.skipServiceWorker()); |
| 78 newRequest.setShouldResetAppCache(request.shouldResetAppCache()); | 78 newRequest.setShouldResetAppCache(request.shouldResetAppCache()); |
| 79 newRequest.setFetchRequestMode(request.getFetchRequestMode()); | 79 newRequest.setFetchRequestMode(request.getFetchRequestMode()); |
| 80 newRequest.setFetchCredentialsMode(request.getFetchCredentialsMode()); | 80 newRequest.setFetchCredentialsMode(request.getFetchCredentialsMode()); |
| 81 newRequest.setHTTPMethod(request.httpMethod()); | 81 newRequest.setHTTPMethod(request.httpMethod()); |
| 82 newRequest.setHTTPBody(request.httpBody()); | 82 newRequest.setHTTPBody(request.httpBody()); |
| 83 | 83 |
| 84 WeakPtr<WebURLLoaderMock> self = weak_factory_.createWeakPtr(); | 84 WeakPtr<WebURLLoaderMock> self = weak_factory_.createWeakPtr(); |
| 85 | 85 |
| 86 client_->willFollowRedirect(this, newRequest, redirectResponse); | 86 client_->willFollowRedirect(this, newRequest, redirectResponse, 0); |
| 87 | 87 |
| 88 // |this| might be deleted in willFollowRedirect(). | 88 // |this| might be deleted in willFollowRedirect(). |
| 89 if (!self) | 89 if (!self) |
| 90 return newRequest; | 90 return newRequest; |
| 91 | 91 |
| 92 if (redirectURL != KURL(newRequest.url())) { | 92 if (redirectURL != KURL(newRequest.url())) { |
| 93 // Only follow the redirect if WebKit left the URL unmodified. | 93 // Only follow the redirect if WebKit left the URL unmodified. |
| 94 // 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 |
| 95 // assume that it does so by setting it to be invalid. | 95 // assume that it does so by setting it to be invalid. |
| 96 DCHECK(!newRequest.url().isValid()); | 96 DCHECK(!newRequest.url().isValid()); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // 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 |
| 159 // 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. |
| 160 DCHECK(runner); | 160 DCHECK(runner); |
| 161 } | 161 } |
| 162 | 162 |
| 163 WeakPtr<WebURLLoaderMock> WebURLLoaderMock::GetWeakPtr() { | 163 WeakPtr<WebURLLoaderMock> WebURLLoaderMock::GetWeakPtr() { |
| 164 return weak_factory_.createWeakPtr(); | 164 return weak_factory_.createWeakPtr(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 } // namespace blink | 167 } // namespace blink |
| OLD | NEW |