| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef LocalFileSystem_h | 31 #ifndef LocalFileSystem_h |
| 32 #define LocalFileSystem_h | 32 #define LocalFileSystem_h |
| 33 | 33 |
| 34 #include "core/frame/LocalFrame.h" |
| 34 #include "core/workers/WorkerClients.h" | 35 #include "core/workers/WorkerClients.h" |
| 35 #include "platform/FileSystemType.h" | 36 #include "platform/FileSystemType.h" |
| 36 #include "platform/Supplementable.h" | 37 #include "platform/Supplementable.h" |
| 37 #include "platform/heap/Handle.h" | 38 #include "platform/heap/Handle.h" |
| 38 #include "wtf/Forward.h" | 39 #include "wtf/Forward.h" |
| 39 #include "wtf/Functional.h" | 40 #include "wtf/Functional.h" |
| 40 #include <memory> | 41 #include <memory> |
| 41 | 42 |
| 42 namespace blink { | 43 namespace blink { |
| 43 | 44 |
| 44 class AsyncFileSystemCallbacks; | 45 class AsyncFileSystemCallbacks; |
| 45 class CallbackWrapper; | 46 class CallbackWrapper; |
| 46 class FileSystemClient; | 47 class FileSystemClient; |
| 47 class ExecutionContext; | 48 class ExecutionContext; |
| 48 class KURL; | 49 class KURL; |
| 49 class LocalFrame; | |
| 50 class WebFileSystem; | 50 class WebFileSystem; |
| 51 | 51 |
| 52 class LocalFileSystem final : public GarbageCollectedFinalized<LocalFileSystem>,
public Supplement<LocalFrame>, public Supplement<WorkerClients> { | 52 class LocalFileSystem final : public GarbageCollectedFinalized<LocalFileSystem>,
public Supplement<LocalFrame>, public Supplement<WorkerClients> { |
| 53 USING_GARBAGE_COLLECTED_MIXIN(LocalFileSystem); | 53 USING_GARBAGE_COLLECTED_MIXIN(LocalFileSystem); |
| 54 WTF_MAKE_NONCOPYABLE(LocalFileSystem); | 54 WTF_MAKE_NONCOPYABLE(LocalFileSystem); |
| 55 public: | 55 public: |
| 56 static LocalFileSystem* create(std::unique_ptr<FileSystemClient>); | 56 static LocalFileSystem* create(std::unique_ptr<FileSystemClient>); |
| 57 ~LocalFileSystem(); | 57 ~LocalFileSystem(); |
| 58 | 58 |
| 59 void resolveURL(ExecutionContext*, const KURL&, std::unique_ptr<AsyncFileSys
temCallbacks>); | 59 void resolveURL(ExecutionContext*, const KURL&, std::unique_ptr<AsyncFileSys
temCallbacks>); |
| 60 void requestFileSystem(ExecutionContext*, FileSystemType, long long size, st
d::unique_ptr<AsyncFileSystemCallbacks>); | 60 void requestFileSystem(ExecutionContext*, FileSystemType, long long size, st
d::unique_ptr<AsyncFileSystemCallbacks>); |
| 61 void deleteFileSystem(ExecutionContext*, FileSystemType, std::unique_ptr<Asy
ncFileSystemCallbacks>); | 61 void deleteFileSystem(ExecutionContext*, FileSystemType, std::unique_ptr<Asy
ncFileSystemCallbacks>); |
| 62 | 62 |
| 63 FileSystemClient* client() const { return m_client.get(); } | 63 FileSystemClient* client() const { return m_client.get(); } |
| 64 | 64 |
| 65 static const char* supplementName(); | 65 static const char* supplementName(); |
| 66 static LocalFileSystem* from(ExecutionContext&); | 66 static LocalFileSystem* from(ExecutionContext&); |
| 67 | 67 |
| 68 DEFINE_INLINE_VIRTUAL_TRACE() | 68 DECLARE_VIRTUAL_TRACE(); |
| 69 { | |
| 70 Supplement<LocalFrame>::trace(visitor); | |
| 71 Supplement<WorkerClients>::trace(visitor); | |
| 72 } | |
| 73 | 69 |
| 74 private: | 70 private: |
| 75 explicit LocalFileSystem(std::unique_ptr<FileSystemClient>); | 71 explicit LocalFileSystem(std::unique_ptr<FileSystemClient>); |
| 76 | 72 |
| 77 WebFileSystem* getFileSystem() const; | 73 WebFileSystem* getFileSystem() const; |
| 78 void fileSystemNotAvailable(ExecutionContext*, CallbackWrapper*); | 74 void fileSystemNotAvailable(ExecutionContext*, CallbackWrapper*); |
| 79 | 75 |
| 80 void requestFileSystemAccessInternal(ExecutionContext*, std::unique_ptr<WTF:
:Closure> allowed, std::unique_ptr<WTF::Closure> denied); | 76 void requestFileSystemAccessInternal(ExecutionContext*, std::unique_ptr<WTF:
:Closure> allowed, std::unique_ptr<WTF::Closure> denied); |
| 81 void fileSystemNotAllowedInternal(ExecutionContext*, CallbackWrapper*); | 77 void fileSystemNotAllowedInternal(ExecutionContext*, CallbackWrapper*); |
| 82 void fileSystemAllowedInternal(ExecutionContext*, FileSystemType, CallbackWr
apper*); | 78 void fileSystemAllowedInternal(ExecutionContext*, FileSystemType, CallbackWr
apper*); |
| 83 void resolveURLInternal(ExecutionContext*, const KURL&, CallbackWrapper*); | 79 void resolveURLInternal(ExecutionContext*, const KURL&, CallbackWrapper*); |
| 84 void deleteFileSystemInternal(ExecutionContext*, FileSystemType, CallbackWra
pper*); | 80 void deleteFileSystemInternal(ExecutionContext*, FileSystemType, CallbackWra
pper*); |
| 85 | 81 |
| 86 std::unique_ptr<FileSystemClient> m_client; | 82 std::unique_ptr<FileSystemClient> m_client; |
| 87 }; | 83 }; |
| 88 | 84 |
| 89 } // namespace blink | 85 } // namespace blink |
| 90 | 86 |
| 91 #endif // LocalFileSystem_h | 87 #endif // LocalFileSystem_h |
| OLD | NEW |