Chromium Code Reviews| 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 13 matching lines...) Expand all Loading... | |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef File_h | 26 #ifndef File_h |
| 27 #define File_h | 27 #define File_h |
| 28 | 28 |
| 29 #include "bindings/core/v8/UnionTypesCore.h" | 29 #include "bindings/core/v8/UnionTypesCore.h" |
| 30 #include "core/CoreExport.h" | 30 #include "core/CoreExport.h" |
| 31 #include "core/fileapi/Blob.h" | 31 #include "core/fileapi/Blob.h" |
| 32 #include "platform/heap/Handle.h" | 32 #include "platform/heap/Handle.h" |
| 33 #include "wtf/PassRefPtr.h" | 33 #include "wtf/PassRefPtr.h" |
| 34 #include "wtf/Vector.h" | |
| 34 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
| 35 | 36 |
| 36 namespace blink { | 37 namespace blink { |
| 37 | 38 |
| 38 class ExceptionState; | 39 class ExceptionState; |
| 39 class ExecutionContext; | 40 class ExecutionContext; |
| 40 class FilePropertyBag; | 41 class FilePropertyBag; |
| 41 class FileMetadata; | 42 class FileMetadata; |
| 42 class KURL; | 43 class KURL; |
| 43 | 44 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 60 | 61 |
| 61 static File* create(const String& path, ContentTypeLookupPolicy policy = Wel lKnownContentTypes) | 62 static File* create(const String& path, ContentTypeLookupPolicy policy = Wel lKnownContentTypes) |
| 62 { | 63 { |
| 63 return new File(path, policy, File::IsUserVisible); | 64 return new File(path, policy, File::IsUserVisible); |
| 64 } | 65 } |
| 65 | 66 |
| 66 static File* create(const String& name, double modificationTime, PassRefPtr< BlobDataHandle> blobDataHandle) | 67 static File* create(const String& name, double modificationTime, PassRefPtr< BlobDataHandle> blobDataHandle) |
| 67 { | 68 { |
| 68 return new File(name, modificationTime, blobDataHandle); | 69 return new File(name, modificationTime, blobDataHandle); |
| 69 } | 70 } |
| 71 | |
| 72 static File* create(Vector<char>* encodedImage, const String& mimeType); | |
|
Justin Novosad
2015/08/13 21:03:40
You don't need to add a dependency on Vector here.
xlai (Olivia)
2015/08/20 19:46:44
Done.
| |
| 70 | 73 |
| 71 // For deserialization. | 74 // For deserialization. |
| 72 static File* createFromSerialization(const String& path, const String& name, const String& relativePath, UserVisibility userVisibility, bool hasSnaphotData, uint64_t size, double lastModified, PassRefPtr<BlobDataHandle> blobDataHandle) | 75 static File* createFromSerialization(const String& path, const String& name, const String& relativePath, UserVisibility userVisibility, bool hasSnaphotData, uint64_t size, double lastModified, PassRefPtr<BlobDataHandle> blobDataHandle) |
| 73 { | 76 { |
| 74 return new File(path, name, relativePath, userVisibility, hasSnaphotData , size, lastModified, blobDataHandle); | 77 return new File(path, name, relativePath, userVisibility, hasSnaphotData , size, lastModified, blobDataHandle); |
| 75 } | 78 } |
| 76 static File* createFromIndexedSerialization(const String& path, const String & name, uint64_t size, double lastModified, PassRefPtr<BlobDataHandle> blobDataH andle) | 79 static File* createFromIndexedSerialization(const String& path, const String & name, uint64_t size, double lastModified, PassRefPtr<BlobDataHandle> blobDataH andle) |
| 77 { | 80 { |
| 78 return new File(path, name, String(), IsNotUserVisible, true, size, last Modified, blobDataHandle); | 81 return new File(path, name, String(), IsNotUserVisible, true, size, last Modified, blobDataHandle); |
| 79 } | 82 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 const double m_snapshotModificationTimeMS; | 184 const double m_snapshotModificationTimeMS; |
| 182 | 185 |
| 183 String m_relativePath; | 186 String m_relativePath; |
| 184 }; | 187 }; |
| 185 | 188 |
| 186 DEFINE_TYPE_CASTS(File, Blob, blob, blob->isFile(), blob.isFile()); | 189 DEFINE_TYPE_CASTS(File, Blob, blob, blob->isFile(), blob.isFile()); |
| 187 | 190 |
| 188 } // namespace blink | 191 } // namespace blink |
| 189 | 192 |
| 190 #endif // File_h | 193 #endif // File_h |
| OLD | NEW |