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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 : Blob(BlobDataHandle::create(createBlobDataForFileWithName(path, name, poli
cy), -1)) | 106 : Blob(BlobDataHandle::create(createBlobDataForFileWithName(path, name, poli
cy), -1)) |
107 , m_hasBackingFile(true) | 107 , m_hasBackingFile(true) |
108 , m_path(path) | 108 , m_path(path) |
109 , m_name(name) | 109 , m_name(name) |
110 , m_snapshotSize(-1) | 110 , m_snapshotSize(-1) |
111 , m_snapshotModificationTime(invalidFileTime()) | 111 , m_snapshotModificationTime(invalidFileTime()) |
112 { | 112 { |
113 ScriptWrappable::init(this); | 113 ScriptWrappable::init(this); |
114 } | 114 } |
115 | 115 |
116 File::File(const String& path, PassRefPtr<BlobDataHandle> blobDataHandle) | 116 File::File(const String& path, const String& name, const String& relativePath, b
ool hasSnaphotData, uint64_t size, double lastModified, PassRefPtr<BlobDataHandl
e> blobDataHandle) |
117 : Blob(blobDataHandle) | 117 : Blob(blobDataHandle) |
118 , m_hasBackingFile(true) | 118 , m_hasBackingFile(!path.isEmpty() || !relativePath.isEmpty()) |
119 , m_path(path) | 119 , m_path(path) |
120 , m_name(blink::Platform::current()->fileUtilities()->baseName(path)) | 120 , m_name(name) |
121 , m_snapshotSize(-1) | 121 , m_snapshotSize(hasSnaphotData ? static_cast<long long>(size) : -1) |
122 , m_snapshotModificationTime(invalidFileTime()) | 122 , m_snapshotModificationTime(hasSnaphotData ? lastModified : invalidFileTime
()) |
| 123 , m_relativePath(relativePath) |
123 { | 124 { |
124 ScriptWrappable::init(this); | 125 ScriptWrappable::init(this); |
125 // FIXME: File object serialization/deserialization does not include | |
126 // newer file object data members: m_name and m_relativePath. | |
127 // See SerializedScriptValue.cpp. | |
128 } | 126 } |
129 | 127 |
130 File::File(const String& name, double modificationTime, PassRefPtr<BlobDataHandl
e> blobDataHandle) | 128 File::File(const String& name, double modificationTime, PassRefPtr<BlobDataHandl
e> blobDataHandle) |
131 : Blob(blobDataHandle) | 129 : Blob(blobDataHandle) |
132 , m_hasBackingFile(false) | 130 , m_hasBackingFile(false) |
133 , m_name(name) | 131 , m_name(name) |
134 , m_snapshotSize(Blob::size()) | 132 , m_snapshotSize(Blob::size()) |
135 , m_snapshotModificationTime(modificationTime) | 133 , m_snapshotModificationTime(modificationTime) |
136 { | 134 { |
137 ScriptWrappable::init(this); | 135 ScriptWrappable::init(this); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 snapshotSize = 0; | 196 snapshotSize = 0; |
199 snapshotModificationTime = invalidFileTime(); | 197 snapshotModificationTime = invalidFileTime(); |
200 return; | 198 return; |
201 } | 199 } |
202 | 200 |
203 snapshotSize = metadata.length; | 201 snapshotSize = metadata.length; |
204 snapshotModificationTime = metadata.modificationTime; | 202 snapshotModificationTime = metadata.modificationTime; |
205 } | 203 } |
206 | 204 |
207 } // namespace WebCore | 205 } // namespace WebCore |
OLD | NEW |