OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 // Returns the relative path of this file in the context of a directory sele
ction. | 129 // Returns the relative path of this file in the context of a directory sele
ction. |
130 const String& webkitRelativePath() const { return m_relativePath; } | 130 const String& webkitRelativePath() const { return m_relativePath; } |
131 | 131 |
132 // Note that this involves synchronous file operation. Think twice before ca
lling this function. | 132 // Note that this involves synchronous file operation. Think twice before ca
lling this function. |
133 void captureSnapshot(long long& snapshotSize, double& snapshotModificationTi
me) const; | 133 void captureSnapshot(long long& snapshotSize, double& snapshotModificationTi
me) const; |
134 | 134 |
135 // Returns true if this has a valid snapshot metadata (i.e. m_snapshotSize >
= 0). | 135 // Returns true if this has a valid snapshot metadata (i.e. m_snapshotSize >
= 0). |
136 bool hasValidSnapshotMetadata() const { return m_snapshotSize >= 0; } | 136 bool hasValidSnapshotMetadata() const { return m_snapshotSize >= 0; } |
137 | 137 |
| 138 // Returns true if the sources (file path, file system URL, or blob handler)
of the file objects are same or not. |
| 139 bool hasSameSource(const File& other) const; |
| 140 |
138 private: | 141 private: |
139 File(const String& path, ContentTypeLookupPolicy, UserVisibility); | 142 File(const String& path, ContentTypeLookupPolicy, UserVisibility); |
140 File(const String& path, const String& name, ContentTypeLookupPolicy, UserVi
sibility); | 143 File(const String& path, const String& name, ContentTypeLookupPolicy, UserVi
sibility); |
141 File(const String& path, const String& name, const String& relativePath, Use
rVisibility, bool hasSnaphotData, uint64_t size, double lastModified, PassRefPtr
<BlobDataHandle>); | 144 File(const String& path, const String& name, const String& relativePath, Use
rVisibility, bool hasSnaphotData, uint64_t size, double lastModified, PassRefPtr
<BlobDataHandle>); |
142 File(const String& name, double modificationTime, PassRefPtr<BlobDataHandle>
); | 145 File(const String& name, double modificationTime, PassRefPtr<BlobDataHandle>
); |
143 File(const String& name, const FileMetadata&, UserVisibility); | 146 File(const String& name, const FileMetadata&, UserVisibility); |
144 File(const KURL& fileSystemURL, const FileMetadata&); | 147 File(const KURL& fileSystemURL, const FileMetadata&); |
145 | 148 |
146 void invalidateSnapshotMetadata() { m_snapshotSize = -1; } | 149 void invalidateSnapshotMetadata() { m_snapshotSize = -1; } |
147 | 150 |
(...skipping 21 matching lines...) Expand all Loading... |
169 const double m_snapshotModificationTime; | 172 const double m_snapshotModificationTime; |
170 | 173 |
171 String m_relativePath; | 174 String m_relativePath; |
172 }; | 175 }; |
173 | 176 |
174 DEFINE_TYPE_CASTS(File, Blob, blob, blob->isFile(), blob.isFile()); | 177 DEFINE_TYPE_CASTS(File, Blob, blob, blob->isFile(), blob.isFile()); |
175 | 178 |
176 } // namespace blink | 179 } // namespace blink |
177 | 180 |
178 #endif // File_h | 181 #endif // File_h |
OLD | NEW |