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(WebURLLoader*, | 50 // |
| 51 // Implementations should return true to instruct the loader to follow the, |
| 52 // redirect, or false otherwise. |
| 53 virtual bool willFollowRedirect(WebURLLoader*, |
51 WebURLRequest& newRequest, | 54 WebURLRequest& newRequest, |
52 const WebURLResponse& redirectResponse) {} | 55 const WebURLResponse& redirectResponse) { |
| 56 return true; |
| 57 } |
53 | 58 |
54 // Called to report upload progress. The bytes reported correspond to | 59 // Called to report upload progress. The bytes reported correspond to |
55 // the HTTP message body. | 60 // the HTTP message body. |
56 virtual void didSendData(WebURLLoader*, | 61 virtual void didSendData(WebURLLoader*, |
57 unsigned long long bytesSent, | 62 unsigned long long bytesSent, |
58 unsigned long long totalBytesToBeSent) {} | 63 unsigned long long totalBytesToBeSent) {} |
59 | 64 |
60 // Called when response headers are received. | 65 // Called when response headers are received. |
61 virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&) {} | 66 virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&) {} |
62 | 67 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // known. | 115 // known. |
111 static const int64_t kUnknownEncodedDataLength = -1; | 116 static const int64_t kUnknownEncodedDataLength = -1; |
112 | 117 |
113 protected: | 118 protected: |
114 virtual ~WebURLLoaderClient() {} | 119 virtual ~WebURLLoaderClient() {} |
115 }; | 120 }; |
116 | 121 |
117 } // namespace blink | 122 } // namespace blink |
118 | 123 |
119 #endif | 124 #endif |
OLD | NEW |