OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 29 matching lines...) Expand all Loading... |
40 class WebURLRequest; | 40 class WebURLRequest; |
41 class WebURLResponse; | 41 class WebURLResponse; |
42 struct WebURLError; | 42 struct WebURLError; |
43 | 43 |
44 class BLINK_PLATFORM_EXPORT WebURLLoaderClient { | 44 class BLINK_PLATFORM_EXPORT WebURLLoaderClient { |
45 public: | 45 public: |
46 // Called when following a redirect. |newRequest| contains the request | 46 // Called when following a redirect. |newRequest| contains the request |
47 // generated by the redirect. The client may modify |newRequest|. | 47 // generated by the redirect. The client may modify |newRequest|. |
48 // |encodedDataLength| is the size of the data that came from the network | 48 // |encodedDataLength| is the size of the data that came from the network |
49 // for this redirect, or zero if the redirect was served from cache. | 49 // for this redirect, or zero if the redirect was served from cache. |
50 virtual void willFollowRedirect( | 50 // |
51 WebURLLoader*, WebURLRequest& newRequest, const WebURLResponse& redirect
Response, int64_t encodedDataLength) {} | 51 // Implementations should return true to instruct the loader to follow the, |
| 52 // redirect, or false otherwise. |
| 53 virtual bool willFollowRedirect( |
| 54 WebURLLoader*, WebURLRequest& newRequest, const WebURLResponse& redirect
Response, int64_t encodedDataLength) { |
| 55 return true; |
| 56 } |
52 | 57 |
53 // Called to report upload progress. The bytes reported correspond to | 58 // Called to report upload progress. The bytes reported correspond to |
54 // the HTTP message body. | 59 // the HTTP message body. |
55 virtual void didSendData( | 60 virtual void didSendData( |
56 WebURLLoader*, unsigned long long bytesSent, unsigned long long totalByt
esToBeSent) { } | 61 WebURLLoader*, unsigned long long bytesSent, unsigned long long totalByt
esToBeSent) { } |
57 | 62 |
58 // Called when response headers are received. | 63 // Called when response headers are received. |
59 virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&) { } | 64 virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&) { } |
60 | 65 |
61 // Called when response headers are received. | 66 // Called when response headers are received. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // Value passed to didFinishLoading when total encoded data length isn't kno
wn. | 100 // Value passed to didFinishLoading when total encoded data length isn't kno
wn. |
96 static const int64_t kUnknownEncodedDataLength = -1; | 101 static const int64_t kUnknownEncodedDataLength = -1; |
97 | 102 |
98 protected: | 103 protected: |
99 virtual ~WebURLLoaderClient() { } | 104 virtual ~WebURLLoaderClient() { } |
100 }; | 105 }; |
101 | 106 |
102 } // namespace blink | 107 } // namespace blink |
103 | 108 |
104 #endif | 109 #endif |
OLD | NEW |