| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 WellKnownContentTypes, | 44 WellKnownContentTypes, |
| 45 AllContentTypes, | 45 AllContentTypes, |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 static PassRefPtr<File> create(const String& path, ContentTypeLookupPolicy p
olicy = WellKnownContentTypes) | 48 static PassRefPtr<File> create(const String& path, ContentTypeLookupPolicy p
olicy = WellKnownContentTypes) |
| 49 { | 49 { |
| 50 return adoptRef(new File(path, policy)); | 50 return adoptRef(new File(path, policy)); |
| 51 } | 51 } |
| 52 | 52 |
| 53 // For deserialization. | 53 // For deserialization. |
| 54 static PassRefPtr<File> create(const String& path, const KURL& srcURL, const
String& type) | 54 static PassRefPtr<File> create(const String& path, const String& uuid, const
String& type) |
| 55 { | 55 { |
| 56 return adoptRef(new File(path, srcURL, type)); | 56 return adoptRef(new File(path, uuid, type)); |
| 57 } | 57 } |
| 58 | 58 |
| 59 #if ENABLE(DIRECTORY_UPLOAD) | 59 #if ENABLE(DIRECTORY_UPLOAD) |
| 60 static PassRefPtr<File> createWithRelativePath(const String& path, const Str
ing& relativePath); | 60 static PassRefPtr<File> createWithRelativePath(const String& path, const Str
ing& relativePath); |
| 61 #endif | 61 #endif |
| 62 | 62 |
| 63 #if ENABLE(FILE_SYSTEM) | 63 #if ENABLE(FILE_SYSTEM) |
| 64 // If filesystem files live in the remote filesystem, the port might pass th
e valid metadata (whose length field is non-negative) and cache in the File obje
ct. | 64 // If filesystem files live in the remote filesystem, the port might pass th
e valid metadata (whose length field is non-negative) and cache in the File obje
ct. |
| 65 // | 65 // |
| 66 // Otherwise calling size(), lastModifiedTime() and slice() will synchronous
ly query the file metadata. | 66 // Otherwise calling size(), lastModifiedTime() and slice() will synchronous
ly query the file metadata. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 const String& webkitRelativePath() const { return m_relativePath; } | 99 const String& webkitRelativePath() const { return m_relativePath; } |
| 100 #endif | 100 #endif |
| 101 | 101 |
| 102 // Note that this involves synchronous file operation. Think twice before ca
lling this function. | 102 // Note that this involves synchronous file operation. Think twice before ca
lling this function. |
| 103 void captureSnapshot(long long& snapshotSize, double& snapshotModificationTi
me) const; | 103 void captureSnapshot(long long& snapshotSize, double& snapshotModificationTi
me) const; |
| 104 | 104 |
| 105 private: | 105 private: |
| 106 File(const String& path, ContentTypeLookupPolicy); | 106 File(const String& path, ContentTypeLookupPolicy); |
| 107 | 107 |
| 108 // For deserialization. | 108 // For deserialization. |
| 109 File(const String& path, const KURL& srcURL, const String& type); | 109 File(const String& path, const String& uuid, const String& type); |
| 110 File(const String& path, const String& name, ContentTypeLookupPolicy); | 110 File(const String& path, const String& name, ContentTypeLookupPolicy); |
| 111 | 111 |
| 112 # if ENABLE(FILE_SYSTEM) | 112 # if ENABLE(FILE_SYSTEM) |
| 113 File(const String& name, const FileMetadata&); | 113 File(const String& name, const FileMetadata&); |
| 114 File(const KURL& fileSystemURL, const FileMetadata&); | 114 File(const KURL& fileSystemURL, const FileMetadata&); |
| 115 | 115 |
| 116 // Returns true if this has a valid snapshot metadata (i.e. m_snapshotSize >
= 0). | 116 // Returns true if this has a valid snapshot metadata (i.e. m_snapshotSize >
= 0). |
| 117 bool hasValidSnapshotMetadata() const { return m_snapshotSize >= 0; } | 117 bool hasValidSnapshotMetadata() const { return m_snapshotSize >= 0; } |
| 118 #endif | 118 #endif |
| 119 | 119 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 142 | 142 |
| 143 inline const File* toFile(const Blob* blob) | 143 inline const File* toFile(const Blob* blob) |
| 144 { | 144 { |
| 145 ASSERT(!blob || blob->isFile()); | 145 ASSERT(!blob || blob->isFile()); |
| 146 return static_cast<const File*>(blob); | 146 return static_cast<const File*>(blob); |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace WebCore | 149 } // namespace WebCore |
| 150 | 150 |
| 151 #endif // File_h | 151 #endif // File_h |
| OLD | NEW |