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" |
11 #include "public/platform/WebURLLoaderClient.h" | 11 #include "public/platform/WebURLLoaderClient.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 void assertFallbackLoaderAvailability(const WebURL& url, | 17 void assertFallbackLoaderAvailability(const WebURL& url, |
18 const WebURLLoader* default_loader) { | 18 const WebURLLoader* default_loader) { |
19 DCHECK(KURL(url).protocolIsData()) << "shouldn't be falling back: " | 19 DCHECK(KURL(url).protocolIsData()) |
20 << url.string().utf8(); | 20 << "shouldn't be falling back: " << url.string().utf8(); |
21 DCHECK(default_loader) << "default_loader wasn't set: " | 21 DCHECK(default_loader) << "default_loader wasn't set: " |
22 << url.string().utf8(); | 22 << url.string().utf8(); |
23 } | 23 } |
24 | 24 |
25 } // namespace | 25 } // namespace |
26 | 26 |
27 WebURLLoaderMock::WebURLLoaderMock(WebURLLoaderMockFactoryImpl* factory, | 27 WebURLLoaderMock::WebURLLoaderMock(WebURLLoaderMockFactoryImpl* factory, |
28 WebURLLoader* default_loader) | 28 WebURLLoader* default_loader) |
29 : factory_(factory), | 29 : factory_(factory), |
30 default_loader_(WTF::wrapUnique(default_loader)), | 30 default_loader_(WTF::wrapUnique(default_loader)), |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // In principle this is NOTIMPLEMENTED(), but if we put that here it floods | 164 // In principle this is NOTIMPLEMENTED(), but if we put that here it floods |
165 // the console during webkit unit tests, so we leave the function empty. | 165 // the console during webkit unit tests, so we leave the function empty. |
166 DCHECK(runner); | 166 DCHECK(runner); |
167 } | 167 } |
168 | 168 |
169 WeakPtr<WebURLLoaderMock> WebURLLoaderMock::GetWeakPtr() { | 169 WeakPtr<WebURLLoaderMock> WebURLLoaderMock::GetWeakPtr() { |
170 return weak_factory_.createWeakPtr(); | 170 return weak_factory_.createWeakPtr(); |
171 } | 171 } |
172 | 172 |
173 } // namespace blink | 173 } // namespace blink |
OLD | NEW |