OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_COMMON_BLOB_BLOB_DATA_H_ | 5 #ifndef WEBKIT_COMMON_BLOB_BLOB_DATA_H_ |
6 #define WEBKIT_COMMON_BLOB_BLOB_DATA_H_ | 6 #define WEBKIT_COMMON_BLOB_BLOB_DATA_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 explicit BlobData(const std::string& uuid); | 29 explicit BlobData(const std::string& uuid); |
30 | 30 |
31 void AppendData(const std::string& data) { | 31 void AppendData(const std::string& data) { |
32 AppendData(data.c_str(), data.size()); | 32 AppendData(data.c_str(), data.size()); |
33 } | 33 } |
34 | 34 |
35 void AppendData(const char* data, size_t length); | 35 void AppendData(const char* data, size_t length); |
36 | 36 |
37 void AppendFile(const base::FilePath& file_path, uint64 offset, uint64 length, | 37 void AppendFile(const base::FilePath& file_path, uint64 offset, uint64 length, |
38 const base::Time& expected_modification_time); | 38 const base::Time& expected_modification_time); |
39 | |
40 // Note: Identifying blobs by url is being deprecated, but while transitioning | |
41 // there's a little of both going on in the project. | |
42 void AppendBlob(const GURL& blob_url, uint64 offset, uint64 length); | |
43 void AppendBlob(const std::string& uuid, uint64 offset, uint64 length); | 39 void AppendBlob(const std::string& uuid, uint64 offset, uint64 length); |
44 | |
45 void AppendFileSystemFile(const GURL& url, uint64 offset, uint64 length, | 40 void AppendFileSystemFile(const GURL& url, uint64 offset, uint64 length, |
46 const base::Time& expected_modification_time); | 41 const base::Time& expected_modification_time); |
47 | 42 |
48 void AttachShareableFileReference(ShareableFileReference* reference) { | 43 void AttachShareableFileReference(ShareableFileReference* reference) { |
49 shareable_files_.push_back(reference); | 44 shareable_files_.push_back(reference); |
50 } | 45 } |
51 | 46 |
52 const std::string& uuid() const { return uuid_; } | 47 const std::string& uuid() const { return uuid_; } |
53 const std::vector<Item>& items() const { return items_; } | 48 const std::vector<Item>& items() const { return items_; } |
54 const std::string& content_type() const { return content_type_; } | 49 const std::string& content_type() const { return content_type_; } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 89 } |
95 | 90 |
96 inline bool operator!=(const BlobData& a, const BlobData& b) { | 91 inline bool operator!=(const BlobData& a, const BlobData& b) { |
97 return !(a == b); | 92 return !(a == b); |
98 } | 93 } |
99 #endif // defined(UNIT_TEST) | 94 #endif // defined(UNIT_TEST) |
100 | 95 |
101 } // namespace webkit_blob | 96 } // namespace webkit_blob |
102 | 97 |
103 #endif // WEBKIT_COMMON_BLOB_BLOB_DATA_H_ | 98 #endif // WEBKIT_COMMON_BLOB_BLOB_DATA_H_ |
OLD | NEW |