| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 exceptionState.throwDOMException( | 115 exceptionState.throwDOMException( |
| 116 SyntaxError, "The 'type' property must consist of ASCII characters."); | 116 SyntaxError, "The 'type' property must consist of ASCII characters."); |
| 117 return nullptr; | 117 return nullptr; |
| 118 } | 118 } |
| 119 | 119 |
| 120 double lastModified; | 120 double lastModified; |
| 121 if (options.hasLastModified()) | 121 if (options.hasLastModified()) |
| 122 lastModified = static_cast<double>(options.lastModified()); | 122 lastModified = static_cast<double>(options.lastModified()); |
| 123 else | 123 else |
| 124 lastModified = currentTimeMS(); | 124 lastModified = currentTimeMS(); |
| 125 ASSERT(options.hasEndings()); | |
| 126 bool normalizeLineEndingsToNative = options.endings() == "native"; | |
| 127 if (normalizeLineEndingsToNative) | |
| 128 UseCounter::count(context, UseCounter::FileAPINativeLineEndings); | |
| 129 | 125 |
| 130 std::unique_ptr<BlobData> blobData = BlobData::create(); | 126 std::unique_ptr<BlobData> blobData = BlobData::create(); |
| 131 blobData->setContentType(options.type().lower()); | 127 blobData->setContentType(options.type().lower()); |
| 132 populateBlobData(blobData.get(), fileBits, normalizeLineEndingsToNative); | 128 populateBlobData(blobData.get(), fileBits); |
| 133 | 129 |
| 134 long long fileSize = blobData->length(); | 130 long long fileSize = blobData->length(); |
| 135 return File::create(fileName, lastModified, | 131 return File::create(fileName, lastModified, |
| 136 BlobDataHandle::create(std::move(blobData), fileSize)); | 132 BlobDataHandle::create(std::move(blobData), fileSize)); |
| 137 } | 133 } |
| 138 | 134 |
| 139 File* File::createWithRelativePath(const String& path, | 135 File* File::createWithRelativePath(const String& path, |
| 140 const String& relativePath) { | 136 const String& relativePath) { |
| 141 File* file = new File(path, File::AllContentTypes, File::IsUserVisible); | 137 File* file = new File(path, File::AllContentTypes, File::IsUserVisible); |
| 142 file->m_relativePath = relativePath; | 138 file->m_relativePath = relativePath; |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 if (m_fileSystemURL.isEmpty() != other.m_fileSystemURL.isEmpty()) | 394 if (m_fileSystemURL.isEmpty() != other.m_fileSystemURL.isEmpty()) |
| 399 return false; | 395 return false; |
| 400 | 396 |
| 401 if (!m_fileSystemURL.isEmpty()) | 397 if (!m_fileSystemURL.isEmpty()) |
| 402 return m_fileSystemURL == other.m_fileSystemURL; | 398 return m_fileSystemURL == other.m_fileSystemURL; |
| 403 | 399 |
| 404 return uuid() == other.uuid(); | 400 return uuid() == other.uuid(); |
| 405 } | 401 } |
| 406 | 402 |
| 407 } // namespace blink | 403 } // namespace blink |
| OLD | NEW |