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 #ifndef WebURLLoaderMockFactory_h | 5 #ifndef WebURLLoaderMockFactory_h |
6 #define WebURLLoaderMockFactory_h | 6 #define WebURLLoaderMockFactory_h |
7 | 7 |
8 #include "public/platform/WebCommon.h" | 8 #include "public/platform/WebCommon.h" |
9 #include "public/platform/WebData.h" | 9 #include "public/platform/WebData.h" |
10 #include "public/platform/WebPassOwnPtr.h" | |
11 #include "public/platform/WebString.h" | 10 #include "public/platform/WebString.h" |
12 #include "public/platform/WebURLLoaderTestDelegate.h" | 11 #include "public/platform/WebURLLoaderTestDelegate.h" |
13 | 12 |
| 13 #include <memory> |
| 14 |
14 namespace blink { | 15 namespace blink { |
15 | 16 |
16 class WebURL; | 17 class WebURL; |
17 class WebURLResponse; | 18 class WebURLResponse; |
18 struct WebURLError; | 19 struct WebURLError; |
19 | 20 |
20 class WebURLLoaderMockFactory { | 21 class WebURLLoaderMockFactory { |
21 public: | 22 public: |
22 static WebPassOwnPtr<WebURLLoaderMockFactory> create(); | 23 static std::unique_ptr<WebURLLoaderMockFactory> create(); |
23 | 24 |
24 virtual ~WebURLLoaderMockFactory() {} | 25 virtual ~WebURLLoaderMockFactory() {} |
25 | 26 |
26 // Create a WebURLLoader that takes care of mocked requests. | 27 // Create a WebURLLoader that takes care of mocked requests. |
27 // Non-mocked request are forwarded to given loader which should not | 28 // Non-mocked request are forwarded to given loader which should not |
28 // be nullptr. | 29 // be nullptr. |
29 virtual WebURLLoader* createURLLoader(WebURLLoader*) = 0; | 30 virtual WebURLLoader* createURLLoader(WebURLLoader*) = 0; |
30 | 31 |
31 // Registers a response and the file to be served when the specified URL | 32 // Registers a response and the file to be served when the specified URL |
32 // is loaded. If no file is specified then the response content will be empt
y. | 33 // is loaded. If no file is specified then the response content will be empt
y. |
(...skipping 15 matching lines...) Expand all Loading... |
48 // FrameTestHelpers instead. | 49 // FrameTestHelpers instead. |
49 virtual void serveAsynchronousRequests() = 0; | 50 virtual void serveAsynchronousRequests() = 0; |
50 | 51 |
51 // Set a delegate that allows callbacks for all WebURLLoaderClients to be in
tercepted. | 52 // Set a delegate that allows callbacks for all WebURLLoaderClients to be in
tercepted. |
52 virtual void setLoaderDelegate(WebURLLoaderTestDelegate*) = 0; | 53 virtual void setLoaderDelegate(WebURLLoaderTestDelegate*) = 0; |
53 }; | 54 }; |
54 | 55 |
55 } // namespace blink | 56 } // namespace blink |
56 | 57 |
57 #endif // WebURLLoaderMockFactory_h | 58 #endif // WebURLLoaderMockFactory_h |
OLD | NEW |