| 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 22 matching lines...) Expand all Loading... |
| 33 #include "wtf/PassRefPtr.h" | 33 #include "wtf/PassRefPtr.h" |
| 34 #include "wtf/text/WTFString.h" | 34 #include "wtf/text/WTFString.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class ExceptionState; | 38 class ExceptionState; |
| 39 class ExecutionContext; | 39 class ExecutionContext; |
| 40 class FilePropertyBag; | 40 class FilePropertyBag; |
| 41 class FileMetadata; | 41 class FileMetadata; |
| 42 class KURL; | 42 class KURL; |
| 43 class ScriptState; |
| 43 | 44 |
| 44 class CORE_EXPORT File final : public Blob { | 45 class CORE_EXPORT File final : public Blob { |
| 45 DEFINE_WRAPPERTYPEINFO(); | 46 DEFINE_WRAPPERTYPEINFO(); |
| 46 | 47 |
| 47 public: | 48 public: |
| 48 // AllContentTypes should only be used when the full path/name are trusted; | 49 // AllContentTypes should only be used when the full path/name are trusted; |
| 49 // otherwise, it could allow arbitrary pages to determine what applications an | 50 // otherwise, it could allow arbitrary pages to determine what applications an |
| 50 // user has installed. | 51 // user has installed. |
| 51 enum ContentTypeLookupPolicy { | 52 enum ContentTypeLookupPolicy { |
| 52 WellKnownContentTypes, | 53 WellKnownContentTypes, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 return new File(path, name, policy, File::IsNotUserVisible); | 145 return new File(path, name, policy, File::IsNotUserVisible); |
| 145 } | 146 } |
| 146 | 147 |
| 147 File* clone(const String& name = String()) const; | 148 File* clone(const String& name = String()) const; |
| 148 | 149 |
| 149 unsigned long long size() const override; | 150 unsigned long long size() const override; |
| 150 Blob* slice(long long start, | 151 Blob* slice(long long start, |
| 151 long long end, | 152 long long end, |
| 152 const String& contentType, | 153 const String& contentType, |
| 153 ExceptionState&) const override; | 154 ExceptionState&) const override; |
| 154 void close(ExecutionContext*, ExceptionState&) override; | 155 void close(ScriptState*, ExceptionState&) override; |
| 155 | 156 |
| 156 bool isFile() const override { return true; } | 157 bool isFile() const override { return true; } |
| 157 bool hasBackingFile() const override { return m_hasBackingFile; } | 158 bool hasBackingFile() const override { return m_hasBackingFile; } |
| 158 | 159 |
| 159 void appendTo(BlobData&) const override; | 160 void appendTo(BlobData&) const override; |
| 160 | 161 |
| 161 const String& path() const { | 162 const String& path() const { |
| 162 ASSERT(hasValidFilePath()); | 163 ASSERT(hasValidFilePath()); |
| 163 return m_path; | 164 return m_path; |
| 164 } | 165 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 const double m_snapshotModificationTimeMS; | 241 const double m_snapshotModificationTimeMS; |
| 241 | 242 |
| 242 String m_relativePath; | 243 String m_relativePath; |
| 243 }; | 244 }; |
| 244 | 245 |
| 245 DEFINE_TYPE_CASTS(File, Blob, blob, blob->isFile(), blob.isFile()); | 246 DEFINE_TYPE_CASTS(File, Blob, blob, blob->isFile(), blob.isFile()); |
| 246 | 247 |
| 247 } // namespace blink | 248 } // namespace blink |
| 248 | 249 |
| 249 #endif // File_h | 250 #endif // File_h |
| OLD | NEW |