OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_TEST_WEBURL_LOADER_MOCK_H_ | 5 #ifndef CONTENT_TEST_WEBURL_LOADER_MOCK_H_ |
6 #define CONTENT_TEST_WEBURL_LOADER_MOCK_H_ | 6 #define CONTENT_TEST_WEBURL_LOADER_MOCK_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 void loadSynchronously(const blink::WebURLRequest& request, | 47 void loadSynchronously(const blink::WebURLRequest& request, |
48 blink::WebURLResponse& response, | 48 blink::WebURLResponse& response, |
49 blink::WebURLError& error, | 49 blink::WebURLError& error, |
50 blink::WebData& data) override; | 50 blink::WebData& data) override; |
51 void loadAsynchronously(const blink::WebURLRequest& request, | 51 void loadAsynchronously(const blink::WebURLRequest& request, |
52 blink::WebURLLoaderClient* client) override; | 52 blink::WebURLLoaderClient* client) override; |
53 void cancel() override; | 53 void cancel() override; |
54 void setDefersLoading(bool defer) override; | 54 void setDefersLoading(bool defer) override; |
55 | 55 |
56 bool isDeferred() { return is_deferred_; } | 56 bool isDeferred() { return is_deferred_; } |
57 bool isCancelled() { return !client_; } | |
jam
2016/02/29 16:41:09
nit: these two should be is_deferred() and is_canc
hiroshige
2016/02/29 21:21:55
Done.
| |
57 | 58 |
58 void setLoadingTaskRunner(blink::WebTaskRunner*) override; | 59 void setLoadingTaskRunner(blink::WebTaskRunner*) override; |
59 | 60 |
61 base::WeakPtr<WebURLLoaderMock> GetWeakPtr(); | |
62 | |
60 private: | 63 private: |
61 WebURLLoaderMockFactory* factory_; | 64 WebURLLoaderMockFactory* factory_; |
62 blink::WebURLLoaderClient* client_; | 65 blink::WebURLLoaderClient* client_; |
63 scoped_ptr<blink::WebURLLoader> default_loader_; | 66 scoped_ptr<blink::WebURLLoader> default_loader_; |
64 bool using_default_loader_; | 67 bool using_default_loader_; |
65 bool is_deferred_; | 68 bool is_deferred_; |
66 | 69 |
67 base::WeakPtrFactory<WebURLLoaderMock> weak_factory_; | 70 base::WeakPtrFactory<WebURLLoaderMock> weak_factory_; |
68 | 71 |
69 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMock); | 72 DISALLOW_COPY_AND_ASSIGN(WebURLLoaderMock); |
70 }; | 73 }; |
71 | 74 |
72 #endif // CONTENT_TEST_WEBURL_LOADER_MOCK_H_ | 75 #endif // CONTENT_TEST_WEBURL_LOADER_MOCK_H_ |
OLD | NEW |