Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: third_party/WebKit/public/platform/WebURLLoaderClient.h

Issue 2540023003: Dispatch encoded_data_length separately in content/child (Closed)
Patch Set: fix Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 // Called when a chunk of response data is downloaded. This is only called 73 // Called when a chunk of response data is downloaded. This is only called
74 // if WebURLRequest's downloadToFile flag was set to true. 74 // if WebURLRequest's downloadToFile flag was set to true.
75 virtual void didDownloadData(int dataLength, int encodedDataLength) {} 75 virtual void didDownloadData(int dataLength, int encodedDataLength) {}
76 76
77 // Called when a chunk of response data is received. |dataLength| is the 77 // Called when a chunk of response data is received. |dataLength| is the
78 // number of bytes pointed to by |data|. |encodedDataLength| is the number 78 // number of bytes pointed to by |data|. |encodedDataLength| is the number
79 // of bytes actually received from network to serve this chunk, including 79 // of bytes actually received from network to serve this chunk, including
80 // HTTP headers and framing if relevant. It is 0 if the response was served 80 // HTTP headers and framing if relevant. It is 0 if the response was served
81 // from cache, and -1 if this information is unavailable. 81 // from cache, and -1 if this information is unavailable.
82 // TODO(ricea): -1 is problematic for consumers maintaining a running 82 virtual void didReceiveData(const char* data, int dataLength) {}
83 // total. Investigate using 0 for all unavailable cases. 83
84 virtual void didReceiveData(const char* data, 84 // Called when the number of bytes actually received from network including
85 int dataLength, 85 // HTTP headers is updated. |transferSizeDiff| is positive.
86 int encodedDataLength) {} 86 virtual void didReceiveTransferSizeUpdate(int transferSizeDiff) {}
87 87
88 // Called when a chunk of renderer-generated metadata is received from the 88 // Called when a chunk of renderer-generated metadata is received from the
89 // cache. 89 // cache.
90 virtual void didReceiveCachedMetadata(const char* data, int dataLength) {} 90 virtual void didReceiveCachedMetadata(const char* data, int dataLength) {}
91 91
92 // Called when the load completes successfully. 92 // Called when the load completes successfully.
93 // |totalEncodedDataLength| may be equal to kUnknownEncodedDataLength. 93 // |totalEncodedDataLength| may be equal to kUnknownEncodedDataLength.
94 virtual void didFinishLoading(double finishTime, 94 virtual void didFinishLoading(double finishTime,
95 int64_t totalEncodedDataLength, 95 int64_t totalEncodedDataLength,
96 int64_t totalEncodedBodyLength) {} 96 int64_t totalEncodedBodyLength) {}
97 97
98 // Called when the load completes with an error. 98 // Called when the load completes with an error.
99 // |totalEncodedDataLength| may be equal to kUnknownEncodedDataLength. 99 // |totalEncodedDataLength| may be equal to kUnknownEncodedDataLength.
100 virtual void didFail(const WebURLError&, 100 virtual void didFail(const WebURLError&,
101 int64_t totalEncodedDataLength, 101 int64_t totalEncodedDataLength,
102 int64_t totalEncodedBodyLength) {} 102 int64_t totalEncodedBodyLength) {}
103 103
104 // Value passed to didFinishLoading when total encoded data length isn't 104 // Value passed to didFinishLoading when total encoded data length isn't
105 // known. 105 // known.
106 static const int64_t kUnknownEncodedDataLength = -1; 106 static const int64_t kUnknownEncodedDataLength = -1;
107 107
108 protected: 108 protected:
109 virtual ~WebURLLoaderClient() {} 109 virtual ~WebURLLoaderClient() {}
110 }; 110 };
111 111
112 } // namespace blink 112 } // namespace blink
113 113
114 #endif 114 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698