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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 | 87 |
88 PassRefPtr<File> File::createWithRelativePath(const String& path, const String& relativePath) | 88 PassRefPtr<File> File::createWithRelativePath(const String& path, const String& relativePath) |
89 { | 89 { |
90 RefPtr<File> file = adoptRef(new File(path, AllContentTypes)); | 90 RefPtr<File> file = adoptRef(new File(path, AllContentTypes)); |
91 file->m_relativePath = relativePath; | 91 file->m_relativePath = relativePath; |
92 return file.release(); | 92 return file.release(); |
93 } | 93 } |
94 | 94 |
95 File::File(const String& path, ContentTypeLookupPolicy policy) | 95 File::File(const String& path, ContentTypeLookupPolicy policy) |
96 : Blob(BlobDataHandle::create(createBlobDataForFile(path, policy), -1)) | 96 : Blob(BlobDataHandle::create(createBlobDataForFile(path, policy), -1)) |
97 , m_isOnFilesystem(true) | |
97 , m_path(path) | 98 , m_path(path) |
98 , m_name(WebKit::Platform::current()->fileUtilities()->baseName(path)) | 99 , m_name(WebKit::Platform::current()->fileUtilities()->baseName(path)) |
99 , m_snapshotSize(-1) | 100 , m_snapshotSize(-1) |
100 , m_snapshotModificationTime(invalidFileTime()) | 101 , m_snapshotModificationTime(invalidFileTime()) |
101 { | 102 { |
102 ScriptWrappable::init(this); | 103 ScriptWrappable::init(this); |
103 } | 104 } |
104 | 105 |
105 File::File(const String& path, const String& name, ContentTypeLookupPolicy polic y) | 106 File::File(const String& path, const String& name, ContentTypeLookupPolicy polic y) |
106 : Blob(BlobDataHandle::create(createBlobDataForFileWithName(path, name, poli cy), -1)) | 107 : Blob(BlobDataHandle::create(createBlobDataForFileWithName(path, name, poli cy), -1)) |
108 , m_isOnFilesystem(true) | |
107 , m_path(path) | 109 , m_path(path) |
108 , m_name(name) | 110 , m_name(name) |
109 , m_snapshotSize(-1) | 111 , m_snapshotSize(-1) |
110 , m_snapshotModificationTime(invalidFileTime()) | 112 , m_snapshotModificationTime(invalidFileTime()) |
111 { | 113 { |
112 ScriptWrappable::init(this); | 114 ScriptWrappable::init(this); |
113 } | 115 } |
114 | 116 |
115 File::File(const String& path, PassRefPtr<BlobDataHandle> blobDataHandle) | 117 File::File(const String& path, PassRefPtr<BlobDataHandle> blobDataHandle) |
116 : Blob(blobDataHandle) | 118 : Blob(blobDataHandle) |
119 , m_isOnFilesystem(true) | |
117 , m_path(path) | 120 , m_path(path) |
118 , m_name(WebKit::Platform::current()->fileUtilities()->baseName(path)) | 121 , m_name(WebKit::Platform::current()->fileUtilities()->baseName(path)) |
119 , m_snapshotSize(-1) | 122 , m_snapshotSize(-1) |
120 , m_snapshotModificationTime(invalidFileTime()) | 123 , m_snapshotModificationTime(invalidFileTime()) |
121 { | 124 { |
122 ScriptWrappable::init(this); | 125 ScriptWrappable::init(this); |
123 // FIXME: File object serialization/deserialization does not include | 126 // FIXME: File object serialization/deserialization does not include |
124 // newer file object data members: m_name and m_relativePath. | 127 // newer file object data members: m_name and m_relativePath. |
125 // See SerializedScriptValue.cpp. | 128 // See SerializedScriptValue.cpp. |
126 } | 129 } |
127 | 130 |
131 File::File(const String& name, double modificationTime, PassRefPtr<BlobDataHandl e> blobDataHandle) | |
132 : Blob(blobDataHandle) | |
133 , m_isOnFilesystem(false) | |
134 , m_path() | |
Inactive
2013/11/04 14:13:11
Not needed
pwnall-personal
2013/11/04 17:16:25
Done.
| |
135 , m_name(name) | |
136 , m_snapshotSize(Blob::size()) | |
137 , m_snapshotModificationTime(modificationTime) | |
138 { | |
139 ScriptWrappable::init(this); | |
140 } | |
141 | |
128 File::File(const String& name, const FileMetadata& metadata) | 142 File::File(const String& name, const FileMetadata& metadata) |
129 : Blob(BlobDataHandle::create(createBlobDataForFileWithMetadata(name, metada ta), metadata.length)) | 143 : Blob(BlobDataHandle::create(createBlobDataForFileWithMetadata(name, metada ta), metadata.length)) |
144 , m_isOnFilesystem(true) | |
130 , m_path(metadata.platformPath) | 145 , m_path(metadata.platformPath) |
131 , m_name(name) | 146 , m_name(name) |
132 , m_snapshotSize(metadata.length) | 147 , m_snapshotSize(metadata.length) |
133 , m_snapshotModificationTime(metadata.modificationTime) | 148 , m_snapshotModificationTime(metadata.modificationTime) |
134 { | 149 { |
135 ScriptWrappable::init(this); | 150 ScriptWrappable::init(this); |
136 } | 151 } |
137 | 152 |
138 File::File(const KURL& fileSystemURL, const FileMetadata& metadata) | 153 File::File(const KURL& fileSystemURL, const FileMetadata& metadata) |
139 : Blob(BlobDataHandle::create(createBlobDataForFileSystemURL(fileSystemURL, metadata), metadata.length)) | 154 : Blob(BlobDataHandle::create(createBlobDataForFileSystemURL(fileSystemURL, metadata), metadata.length)) |
155 , m_isOnFilesystem(true) | |
140 , m_fileSystemURL(fileSystemURL) | 156 , m_fileSystemURL(fileSystemURL) |
141 , m_snapshotSize(metadata.length) | 157 , m_snapshotSize(metadata.length) |
142 , m_snapshotModificationTime(metadata.modificationTime) | 158 , m_snapshotModificationTime(metadata.modificationTime) |
143 { | 159 { |
144 ScriptWrappable::init(this); | 160 ScriptWrappable::init(this); |
145 } | 161 } |
146 | 162 |
147 double File::lastModifiedDate() const | 163 double File::lastModifiedDate() const |
148 { | 164 { |
149 if (hasValidSnapshotMetadata() && isValidFileTime(m_snapshotModificationTime )) | 165 if (hasValidSnapshotMetadata() && isValidFileTime(m_snapshotModificationTime )) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 snapshotSize = 0; | 200 snapshotSize = 0; |
185 snapshotModificationTime = invalidFileTime(); | 201 snapshotModificationTime = invalidFileTime(); |
186 return; | 202 return; |
187 } | 203 } |
188 | 204 |
189 snapshotSize = metadata.length; | 205 snapshotSize = metadata.length; |
190 snapshotModificationTime = metadata.modificationTime; | 206 snapshotModificationTime = metadata.modificationTime; |
191 } | 207 } |
192 | 208 |
193 } // namespace WebCore | 209 } // namespace WebCore |
OLD | NEW |