| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // Default constructor. | 66 // Default constructor. |
| 67 BlobDataItem() | 67 BlobDataItem() |
| 68 : type(Data), | 68 : type(Data), |
| 69 offset(0), | 69 offset(0), |
| 70 length(toEndOfFile), | 70 length(toEndOfFile), |
| 71 expectedModificationTime(invalidFileTime()) {} | 71 expectedModificationTime(invalidFileTime()) {} |
| 72 | 72 |
| 73 // Constructor for String type (complete string). | 73 // Constructor for String type (complete string). |
| 74 explicit BlobDataItem(PassRefPtr<RawData> data) | 74 explicit BlobDataItem(PassRefPtr<RawData> data) |
| 75 : type(Data), | 75 : type(Data), |
| 76 data(data), | 76 data(std::move(data)), |
| 77 offset(0), | 77 offset(0), |
| 78 length(toEndOfFile), | 78 length(toEndOfFile), |
| 79 expectedModificationTime(invalidFileTime()) {} | 79 expectedModificationTime(invalidFileTime()) {} |
| 80 | 80 |
| 81 // Constructor for File type (complete file). | 81 // Constructor for File type (complete file). |
| 82 explicit BlobDataItem(const String& path) | 82 explicit BlobDataItem(const String& path) |
| 83 : type(File), | 83 : type(File), |
| 84 path(path), | 84 path(path), |
| 85 offset(0), | 85 offset(0), |
| 86 length(toEndOfFile), | 86 length(toEndOfFile), |
| 87 expectedModificationTime(invalidFileTime()) {} | 87 expectedModificationTime(invalidFileTime()) {} |
| 88 | 88 |
| 89 // Constructor for File type (partial file). | 89 // Constructor for File type (partial file). |
| 90 BlobDataItem(const String& path, | 90 BlobDataItem(const String& path, |
| 91 long long offset, | 91 long long offset, |
| 92 long long length, | 92 long long length, |
| 93 double expectedModificationTime) | 93 double expectedModificationTime) |
| 94 : type(File), | 94 : type(File), |
| 95 path(path), | 95 path(path), |
| 96 offset(offset), | 96 offset(offset), |
| 97 length(length), | 97 length(length), |
| 98 expectedModificationTime(expectedModificationTime) {} | 98 expectedModificationTime(expectedModificationTime) {} |
| 99 | 99 |
| 100 // Constructor for Blob type. | 100 // Constructor for Blob type. |
| 101 BlobDataItem(PassRefPtr<BlobDataHandle> blobDataHandle, | 101 BlobDataItem(PassRefPtr<BlobDataHandle> blobDataHandle, |
| 102 long long offset, | 102 long long offset, |
| 103 long long length) | 103 long long length) |
| 104 : type(Blob), | 104 : type(Blob), |
| 105 blobDataHandle(blobDataHandle), | 105 blobDataHandle(std::move(blobDataHandle)), |
| 106 offset(offset), | 106 offset(offset), |
| 107 length(length), | 107 length(length), |
| 108 expectedModificationTime(invalidFileTime()) {} | 108 expectedModificationTime(invalidFileTime()) {} |
| 109 | 109 |
| 110 // Constructor for FileSystem file type. | 110 // Constructor for FileSystem file type. |
| 111 BlobDataItem(const KURL& fileSystemURL, | 111 BlobDataItem(const KURL& fileSystemURL, |
| 112 long long offset, | 112 long long offset, |
| 113 long long length, | 113 long long length, |
| 114 double expectedModificationTime) | 114 double expectedModificationTime) |
| 115 : type(FileSystemURL), | 115 : type(FileSystemURL), |
| (...skipping 15 matching lines...) Expand all Loading... |
| 131 long long offset; | 131 long long offset; |
| 132 long long length; | 132 long long length; |
| 133 double expectedModificationTime; | 133 double expectedModificationTime; |
| 134 | 134 |
| 135 private: | 135 private: |
| 136 friend class BlobData; | 136 friend class BlobData; |
| 137 | 137 |
| 138 // Constructor for String type (partial string). | 138 // Constructor for String type (partial string). |
| 139 BlobDataItem(PassRefPtr<RawData> data, long long offset, long long length) | 139 BlobDataItem(PassRefPtr<RawData> data, long long offset, long long length) |
| 140 : type(Data), | 140 : type(Data), |
| 141 data(data), | 141 data(std::move(data)), |
| 142 offset(offset), | 142 offset(offset), |
| 143 length(length), | 143 length(length), |
| 144 expectedModificationTime(invalidFileTime()) {} | 144 expectedModificationTime(invalidFileTime()) {} |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 typedef Vector<BlobDataItem> BlobDataItemList; | 147 typedef Vector<BlobDataItem> BlobDataItemList; |
| 148 | 148 |
| 149 class PLATFORM_EXPORT BlobData { | 149 class PLATFORM_EXPORT BlobData { |
| 150 USING_FAST_MALLOC(BlobData); | 150 USING_FAST_MALLOC(BlobData); |
| 151 WTF_MAKE_NONCOPYABLE(BlobData); | 151 WTF_MAKE_NONCOPYABLE(BlobData); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 BlobDataHandle(const String& uuid, const String& type, long long size); | 236 BlobDataHandle(const String& uuid, const String& type, long long size); |
| 237 | 237 |
| 238 const String m_uuid; | 238 const String m_uuid; |
| 239 const String m_type; | 239 const String m_type; |
| 240 const long long m_size; | 240 const long long m_size; |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 } // namespace blink | 243 } // namespace blink |
| 244 | 244 |
| 245 #endif // BlobData_h | 245 #endif // BlobData_h |
| OLD | NEW |