Index: net/base/upload_data.h |
diff --git a/net/base/upload_data.h b/net/base/upload_data.h |
index 02880d3e5f84b65b3591e505d10abdfaebcad490..bd3f8f4089c981449d772afda6ab682fb1281e37 100644 |
--- a/net/base/upload_data.h |
+++ b/net/base/upload_data.h |
@@ -24,7 +24,7 @@ class UploadData : public base::RefCounted<UploadData> { |
class Element { |
public: |
Element() : type_(TYPE_BYTES), file_range_offset_(0), |
- file_range_length_(kuint64max) { |
+ file_range_length_(kuint64max), expected_file_length_(-1) { |
} |
Type type() const { return type_; } |
@@ -32,6 +32,7 @@ class UploadData : public base::RefCounted<UploadData> { |
const FilePath& file_path() const { return file_path_; } |
uint64 file_range_offset() const { return file_range_offset_; } |
uint64 file_range_length() const { return file_range_length_; } |
+ int64 expected_length() const { return expected_file_length_; } |
wtc
2010/01/12 19:51:02
Nit: rename this method expected_file_size and the
agl
2010/01/25 14:14:09
Done.
|
void SetToBytes(const char* bytes, int bytes_len) { |
type_ = TYPE_BYTES; |
@@ -60,6 +61,11 @@ class UploadData : public base::RefCounted<UploadData> { |
FilePath file_path_; |
uint64 file_range_offset_; |
uint64 file_range_length_; |
+ |
+ // If this Element is a file, then this is the length that we expect it to |
+ // have. This allows us to detect when a file has been truncated from under |
+ // us. This is only valid after calling GetContentLength(). |
+ mutable int64 expected_file_length_; |
wtc
2010/01/12 19:51:02
Does this member need to be mutable?
agl
2010/01/25 14:14:09
It's changed inside of GetContextLength, which is
|
}; |
void AppendBytes(const char* bytes, int bytes_len) { |