| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_path(path) | 97 , m_path(path) |
| 98 , m_name(WebKit::Platform::current()->fileUtilities()->baseName(path)) | 98 , m_name(blink::Platform::current()->fileUtilities()->baseName(path)) |
| 99 , m_snapshotSize(-1) | 99 , m_snapshotSize(-1) |
| 100 , m_snapshotModificationTime(invalidFileTime()) | 100 , m_snapshotModificationTime(invalidFileTime()) |
| 101 { | 101 { |
| 102 ScriptWrappable::init(this); | 102 ScriptWrappable::init(this); |
| 103 } | 103 } |
| 104 | 104 |
| 105 File::File(const String& path, const String& name, ContentTypeLookupPolicy polic
y) | 105 File::File(const String& path, const String& name, ContentTypeLookupPolicy polic
y) |
| 106 : Blob(BlobDataHandle::create(createBlobDataForFileWithName(path, name, poli
cy), -1)) | 106 : Blob(BlobDataHandle::create(createBlobDataForFileWithName(path, name, poli
cy), -1)) |
| 107 , m_path(path) | 107 , m_path(path) |
| 108 , m_name(name) | 108 , m_name(name) |
| 109 , m_snapshotSize(-1) | 109 , m_snapshotSize(-1) |
| 110 , m_snapshotModificationTime(invalidFileTime()) | 110 , m_snapshotModificationTime(invalidFileTime()) |
| 111 { | 111 { |
| 112 ScriptWrappable::init(this); | 112 ScriptWrappable::init(this); |
| 113 } | 113 } |
| 114 | 114 |
| 115 File::File(const String& path, PassRefPtr<BlobDataHandle> blobDataHandle) | 115 File::File(const String& path, PassRefPtr<BlobDataHandle> blobDataHandle) |
| 116 : Blob(blobDataHandle) | 116 : Blob(blobDataHandle) |
| 117 , m_path(path) | 117 , m_path(path) |
| 118 , m_name(WebKit::Platform::current()->fileUtilities()->baseName(path)) | 118 , m_name(blink::Platform::current()->fileUtilities()->baseName(path)) |
| 119 , m_snapshotSize(-1) | 119 , m_snapshotSize(-1) |
| 120 , m_snapshotModificationTime(invalidFileTime()) | 120 , m_snapshotModificationTime(invalidFileTime()) |
| 121 { | 121 { |
| 122 ScriptWrappable::init(this); | 122 ScriptWrappable::init(this); |
| 123 // FIXME: File object serialization/deserialization does not include | 123 // FIXME: File object serialization/deserialization does not include |
| 124 // newer file object data members: m_name and m_relativePath. | 124 // newer file object data members: m_name and m_relativePath. |
| 125 // See SerializedScriptValue.cpp. | 125 // See SerializedScriptValue.cpp. |
| 126 } | 126 } |
| 127 | 127 |
| 128 File::File(const String& name, const FileMetadata& metadata) | 128 File::File(const String& name, const FileMetadata& metadata) |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 snapshotSize = 0; | 184 snapshotSize = 0; |
| 185 snapshotModificationTime = invalidFileTime(); | 185 snapshotModificationTime = invalidFileTime(); |
| 186 return; | 186 return; |
| 187 } | 187 } |
| 188 | 188 |
| 189 snapshotSize = metadata.length; | 189 snapshotSize = metadata.length; |
| 190 snapshotModificationTime = metadata.modificationTime; | 190 snapshotModificationTime = metadata.modificationTime; |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace WebCore | 193 } // namespace WebCore |
| OLD | NEW |