Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: third_party/WebKit/Source/platform/testing/weburl_loader_mock.cc

Issue 1926193002: Clean up ResourceLoader finish more, remove ConnectionState enum (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@finish_smaller
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceLoader.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "wtf/PassOwnPtr.h" 12 #include "wtf/PassOwnPtr.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 WebURLLoaderMock::WebURLLoaderMock(WebURLLoaderMockFactoryImpl* factory, 16 WebURLLoaderMock::WebURLLoaderMock(WebURLLoaderMockFactoryImpl* factory,
17 WebURLLoader* default_loader) 17 WebURLLoader* default_loader)
18 : factory_(factory), 18 : factory_(factory),
19 default_loader_(adoptPtr(default_loader)), 19 default_loader_(adoptPtr(default_loader)),
20 weak_factory_(this) { 20 weak_factory_(this) {
21 } 21 }
22 22
23 WebURLLoaderMock::~WebURLLoaderMock() { 23 WebURLLoaderMock::~WebURLLoaderMock() {
24 cancel();
24 } 25 }
25 26
26 void WebURLLoaderMock::ServeAsynchronousRequest( 27 void WebURLLoaderMock::ServeAsynchronousRequest(
27 WebURLLoaderTestDelegate* delegate, 28 WebURLLoaderTestDelegate* delegate,
28 const WebURLResponse& response, 29 const WebURLResponse& response,
29 const WebData& data, 30 const WebData& data,
30 const WebURLError& error) { 31 const WebURLError& error) {
31 DCHECK(!using_default_loader_); 32 DCHECK(!using_default_loader_);
32 if (!client_) 33 if (!client_)
33 return; 34 return;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // In principle this is NOTIMPLEMENTED(), but if we put that here it floods 159 // 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. 160 // the console during webkit unit tests, so we leave the function empty.
160 DCHECK(runner); 161 DCHECK(runner);
161 } 162 }
162 163
163 WeakPtr<WebURLLoaderMock> WebURLLoaderMock::GetWeakPtr() { 164 WeakPtr<WebURLLoaderMock> WebURLLoaderMock::GetWeakPtr() {
164 return weak_factory_.createWeakPtr(); 165 return weak_factory_.createWeakPtr();
165 } 166 }
166 167
167 } // namespace blink 168 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698