| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 File(const String& name, const FileMetadata&, UserVisibility); | 143 File(const String& name, const FileMetadata&, UserVisibility); |
| 144 File(const KURL& fileSystemURL, const FileMetadata&); | 144 File(const KURL& fileSystemURL, const FileMetadata&); |
| 145 | 145 |
| 146 void invalidateSnapshotMetadata() { m_snapshotSize = -1; } | 146 void invalidateSnapshotMetadata() { m_snapshotSize = -1; } |
| 147 | 147 |
| 148 // Returns File's last modified time (in MS since Epoch.) | 148 // Returns File's last modified time (in MS since Epoch.) |
| 149 // If the modification time isn't known, the current time is returned. | 149 // If the modification time isn't known, the current time is returned. |
| 150 double lastModifiedMS() const; | 150 double lastModifiedMS() const; |
| 151 | 151 |
| 152 #if ENABLE(ASSERT) | 152 #if ENABLE(ASSERT) |
| 153 bool hasValidFileSystemURL() const { return hasBackingFile(); } | 153 // Instances backed by a file must have an empty file system URL. |
| 154 bool hasValidFileSystemURL() const { return !hasBackingFile() || m_fileSyste
mURL.isEmpty(); } |
| 154 // Instances not backed by a file must have an empty path set. | 155 // Instances not backed by a file must have an empty path set. |
| 155 bool hasValidFilePath() const { return hasBackingFile() || m_path.isEmpty();
} | 156 bool hasValidFilePath() const { return hasBackingFile() || m_path.isEmpty();
} |
| 156 #endif | 157 #endif |
| 157 | 158 |
| 158 bool m_hasBackingFile; | 159 bool m_hasBackingFile; |
| 159 UserVisibility m_userVisibility; | 160 UserVisibility m_userVisibility; |
| 160 String m_path; | 161 String m_path; |
| 161 String m_name; | 162 String m_name; |
| 162 | 163 |
| 163 KURL m_fileSystemURL; | 164 KURL m_fileSystemURL; |
| 164 | 165 |
| 165 // If m_snapshotSize is negative (initialized to -1 by default), the snapsho
t metadata is invalid and we retrieve the latest metadata synchronously in size(
), lastModifiedTime() and slice(). | 166 // If m_snapshotSize is negative (initialized to -1 by default), the snapsho
t metadata is invalid and we retrieve the latest metadata synchronously in size(
), lastModifiedTime() and slice(). |
| 166 // Otherwise, the snapshot metadata are used directly in those methods. | 167 // Otherwise, the snapshot metadata are used directly in those methods. |
| 167 long long m_snapshotSize; | 168 long long m_snapshotSize; |
| 168 const double m_snapshotModificationTime; | 169 const double m_snapshotModificationTime; |
| 169 | 170 |
| 170 String m_relativePath; | 171 String m_relativePath; |
| 171 }; | 172 }; |
| 172 | 173 |
| 173 DEFINE_TYPE_CASTS(File, Blob, blob, blob->isFile(), blob.isFile()); | 174 DEFINE_TYPE_CASTS(File, Blob, blob, blob->isFile(), blob.isFile()); |
| 174 | 175 |
| 175 } // namespace blink | 176 } // namespace blink |
| 176 | 177 |
| 177 #endif // File_h | 178 #endif // File_h |
| OLD | NEW |