OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef WebURLLoader_h | 31 #ifndef WebURLLoader_h |
32 #define WebURLLoader_h | 32 #define WebURLLoader_h |
33 | 33 |
34 #include "WebCommon.h" | 34 #include "WebCommon.h" |
35 #include "WebURLRequest.h" | 35 #include "WebURLRequest.h" |
| 36 #include <stdint.h> |
36 | 37 |
37 namespace blink { | 38 namespace blink { |
38 | 39 |
39 class WebData; | 40 class WebData; |
40 class WebTaskRunner; | 41 class WebTaskRunner; |
41 class WebURLLoaderClient; | 42 class WebURLLoaderClient; |
42 class WebURLResponse; | 43 class WebURLResponse; |
43 struct WebURLError; | 44 struct WebURLError; |
44 | 45 |
45 class WebURLLoader { | 46 class WebURLLoader { |
46 public: | 47 public: |
47 // The WebURLLoader may be deleted in a call to its client. | 48 // The WebURLLoader may be deleted in a call to its client. |
48 virtual ~WebURLLoader() {} | 49 virtual ~WebURLLoader() {} |
49 | 50 |
50 // Load the request synchronously, returning results directly to the | 51 // Load the request synchronously, returning results directly to the |
51 // caller upon completion. There is no mechanism to interrupt a | 52 // caller upon completion. There is no mechanism to interrupt a |
52 // synchronous load!! | 53 // synchronous load!! |
53 virtual void loadSynchronously(const WebURLRequest&, | 54 virtual void loadSynchronously(const WebURLRequest&, |
54 WebURLResponse&, WebURLError&, WebData& data) = 0; | 55 WebURLResponse&, WebURLError&, WebData&, |
| 56 int64_t& encodedDataLength) = 0; |
55 | 57 |
56 // Load the request asynchronously, sending notifications to the given | 58 // Load the request asynchronously, sending notifications to the given |
57 // client. The client will receive no further notifications if the | 59 // client. The client will receive no further notifications if the |
58 // loader is disposed before it completes its work. | 60 // loader is disposed before it completes its work. |
59 virtual void loadAsynchronously(const WebURLRequest&, | 61 virtual void loadAsynchronously(const WebURLRequest&, |
60 WebURLLoaderClient*) = 0; | 62 WebURLLoaderClient*) = 0; |
61 | 63 |
62 // Cancels an asynchronous load. This will appear as a load error to | 64 // Cancels an asynchronous load. This will appear as a load error to |
63 // the client. | 65 // the client. |
64 virtual void cancel() = 0; | 66 virtual void cancel() = 0; |
65 | 67 |
66 // Suspends/resumes an asynchronous load. | 68 // Suspends/resumes an asynchronous load. |
67 virtual void setDefersLoading(bool) = 0; | 69 virtual void setDefersLoading(bool) = 0; |
68 | 70 |
69 // Notifies the loader that the priority of a WebURLRequest has changed from | 71 // Notifies the loader that the priority of a WebURLRequest has changed from |
70 // its previous value. For example, a preload request starts with low | 72 // its previous value. For example, a preload request starts with low |
71 // priority, but may increase when the resource is needed for rendering. | 73 // priority, but may increase when the resource is needed for rendering. |
72 virtual void didChangePriority(WebURLRequest::Priority newPriority) { } | 74 virtual void didChangePriority(WebURLRequest::Priority newPriority) { } |
73 virtual void didChangePriority(WebURLRequest::Priority newPriority, int intr
aPriorityValue) { didChangePriority(newPriority); } | 75 virtual void didChangePriority(WebURLRequest::Priority newPriority, int intr
aPriorityValue) { didChangePriority(newPriority); } |
74 | 76 |
75 // Sets the task runner for which any loading tasks should be posted on. | 77 // Sets the task runner for which any loading tasks should be posted on. |
76 // Takes ownership of the WebTaskRunner. | 78 // Takes ownership of the WebTaskRunner. |
77 virtual void setLoadingTaskRunner(WebTaskRunner*) = 0; | 79 virtual void setLoadingTaskRunner(WebTaskRunner*) = 0; |
78 }; | 80 }; |
79 | 81 |
80 } // namespace blink | 82 } // namespace blink |
81 | 83 |
82 #endif | 84 #endif |
OLD | NEW |