Chromium Code Reviews| 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 26 matching lines...) Expand all Loading... | |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class WebURLLoader; | 39 class WebURLLoader; |
| 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|. |
|
kinuko
2016/07/04 04:08:12
could we update the comment?
Adam Rice
2016/07/04 06:33:42
Done.
| |
| 48 virtual void willFollowRedirect( | 48 virtual void willFollowRedirect( |
| 49 WebURLLoader*, WebURLRequest& newRequest, const WebURLResponse& redirect Response) { } | 49 WebURLLoader*, WebURLRequest& newRequest, const WebURLResponse& redirect Response, int64_t encodedDataLength) {} |
| 50 | 50 |
| 51 // Called to report upload progress. The bytes reported correspond to | 51 // Called to report upload progress. The bytes reported correspond to |
| 52 // the HTTP message body. | 52 // the HTTP message body. |
| 53 virtual void didSendData( | 53 virtual void didSendData( |
| 54 WebURLLoader*, unsigned long long bytesSent, unsigned long long totalByt esToBeSent) { } | 54 WebURLLoader*, unsigned long long bytesSent, unsigned long long totalByt esToBeSent) { } |
| 55 | 55 |
| 56 // Called when response headers are received. | 56 // Called when response headers are received. |
| 57 virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&) { } | 57 virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&) { } |
| 58 | 58 |
| 59 // Called when response headers are received. | 59 // Called when response headers are received. |
| 60 // The ownership of |handle| is transferred to the callee. | 60 // The ownership of |handle| is transferred to the callee. |
| 61 virtual void didReceiveResponse(WebURLLoader* loader, const WebURLResponse& response, WebDataConsumerHandle* handle) | 61 virtual void didReceiveResponse(WebURLLoader* loader, const WebURLResponse& response, WebDataConsumerHandle* handle) |
| 62 { | 62 { |
| 63 delete handle; | 63 delete handle; |
| 64 didReceiveResponse(loader, response); | 64 didReceiveResponse(loader, response); |
| 65 } | 65 } |
| 66 | 66 |
| 67 // Called when a chunk of response data is downloaded. This is only called | 67 // Called when a chunk of response data is downloaded. This is only called |
| 68 // if WebURLRequest's downloadToFile flag was set to true. | 68 // if WebURLRequest's downloadToFile flag was set to true. |
| 69 virtual void didDownloadData(WebURLLoader*, int dataLength, int encodedDataL ength) { } | 69 virtual void didDownloadData(WebURLLoader*, int dataLength, int encodedDataL ength) { } |
| 70 | 70 |
| 71 // Called when a chunk of response data is received. | 71 // Called when a chunk of response data is received. |
|
kinuko
2016/07/04 04:08:12
Ditto.
Also: similar to other comments, we seem t
Adam Rice
2016/07/04 06:33:42
I have documented this method as taking -1 when th
| |
| 72 virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength, int encodedDataLength) { } | 72 virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength, int encodedDataLength, int encodedBodyLength) {} |
| 73 | 73 |
| 74 // Called when a chunk of renderer-generated metadata is received from the c ache. | 74 // Called when a chunk of renderer-generated metadata is received from the c ache. |
| 75 virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int d ataLength) { } | 75 virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int d ataLength) { } |
| 76 | 76 |
| 77 // Called when the load completes successfully. | 77 // Called when the load completes successfully. |
| 78 // |totalEncodedDataLength| may be equal to kUnknownEncodedDataLength. | 78 // |totalEncodedDataLength| may be equal to kUnknownEncodedDataLength. |
| 79 virtual void didFinishLoading(WebURLLoader* loader, double finishTime, int64 _t totalEncodedDataLength) { } | 79 virtual void didFinishLoading(WebURLLoader* loader, double finishTime, int64 _t totalEncodedDataLength) { } |
| 80 | 80 |
| 81 // Called when the load completes with an error. | 81 // Called when the load completes with an error. |
| 82 virtual void didFail(WebURLLoader*, const WebURLError&) { } | 82 virtual void didFail(WebURLLoader*, const WebURLError&) { } |
| 83 | 83 |
| 84 // Value passed to didFinishLoading when total encoded data length isn't kno wn. | 84 // Value passed to didFinishLoading when total encoded data length isn't kno wn. |
| 85 static const int64_t kUnknownEncodedDataLength = -1; | 85 static const int64_t kUnknownEncodedDataLength = -1; |
| 86 | 86 |
| 87 protected: | 87 protected: |
| 88 virtual ~WebURLLoaderClient() { } | 88 virtual ~WebURLLoaderClient() { } |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace blink | 91 } // namespace blink |
| 92 | 92 |
| 93 #endif | 93 #endif |
| OLD | NEW |