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 15 matching lines...) Expand all Loading... |
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/workers/WorkerClients.h" | 34 #include "core/workers/WorkerClients.h" |
35 #include "platform/FileSystemType.h" | 35 #include "platform/FileSystemType.h" |
| 36 #include "platform/Supplementable.h" |
| 37 #include "platform/heap/Handle.h" |
36 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
37 #include "wtf/Functional.h" | 39 #include "wtf/Functional.h" |
38 #include "wtf/PassOwnPtr.h" | 40 #include "wtf/PassOwnPtr.h" |
39 | 41 |
40 namespace blink { | 42 namespace blink { |
41 | 43 |
42 class AsyncFileSystemCallbacks; | 44 class AsyncFileSystemCallbacks; |
43 class CallbackWrapper; | 45 class CallbackWrapper; |
44 class FileSystemClient; | 46 class FileSystemClient; |
45 class ExecutionContext; | 47 class ExecutionContext; |
46 class KURL; | 48 class KURL; |
47 class LocalFrame; | 49 class LocalFrame; |
48 class WebFileSystem; | 50 class WebFileSystem; |
49 | 51 |
50 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> { |
51 USING_GARBAGE_COLLECTED_MIXIN(LocalFileSystem); | 53 USING_GARBAGE_COLLECTED_MIXIN(LocalFileSystem); |
52 WTF_MAKE_NONCOPYABLE(LocalFileSystem); | 54 WTF_MAKE_NONCOPYABLE(LocalFileSystem); |
53 public: | 55 public: |
54 static LocalFileSystem* create(PassOwnPtr<FileSystemClient>); | 56 static LocalFileSystem* create(PassOwnPtr<FileSystemClient>); |
55 virtual ~LocalFileSystem(); | 57 ~LocalFileSystem(); |
56 | 58 |
57 void resolveURL(ExecutionContext*, const KURL&, PassOwnPtr<AsyncFileSystemCa
llbacks>); | 59 void resolveURL(ExecutionContext*, const KURL&, PassOwnPtr<AsyncFileSystemCa
llbacks>); |
58 void requestFileSystem(ExecutionContext*, FileSystemType, long long size, Pa
ssOwnPtr<AsyncFileSystemCallbacks>); | 60 void requestFileSystem(ExecutionContext*, FileSystemType, long long size, Pa
ssOwnPtr<AsyncFileSystemCallbacks>); |
59 void deleteFileSystem(ExecutionContext*, FileSystemType, PassOwnPtr<AsyncFil
eSystemCallbacks>); | 61 void deleteFileSystem(ExecutionContext*, FileSystemType, PassOwnPtr<AsyncFil
eSystemCallbacks>); |
60 | 62 |
61 FileSystemClient* client() { return m_client.get(); } | 63 FileSystemClient* client() const { return m_client.get(); } |
62 | 64 |
63 static const char* supplementName(); | 65 static const char* supplementName(); |
64 static LocalFileSystem* from(ExecutionContext&); | 66 static LocalFileSystem* from(ExecutionContext&); |
65 | 67 |
66 DEFINE_INLINE_VIRTUAL_TRACE() | 68 DEFINE_INLINE_VIRTUAL_TRACE() |
67 { | 69 { |
68 Supplement<LocalFrame>::trace(visitor); | 70 Supplement<LocalFrame>::trace(visitor); |
69 Supplement<WorkerClients>::trace(visitor); | 71 Supplement<WorkerClients>::trace(visitor); |
70 } | 72 } |
71 | 73 |
72 protected: | 74 private: |
73 explicit LocalFileSystem(PassOwnPtr<FileSystemClient>); | 75 explicit LocalFileSystem(PassOwnPtr<FileSystemClient>); |
74 | 76 |
75 private: | 77 WebFileSystem* getFileSystem() const; |
76 WebFileSystem* fileSystem() const; | 78 void fileSystemNotAvailable(ExecutionContext*, CallbackWrapper*); |
| 79 |
77 void requestFileSystemAccessInternal(ExecutionContext*, std::unique_ptr<Same
ThreadClosure> allowed, std::unique_ptr<SameThreadClosure> denied); | 80 void requestFileSystemAccessInternal(ExecutionContext*, std::unique_ptr<Same
ThreadClosure> allowed, std::unique_ptr<SameThreadClosure> denied); |
78 void fileSystemNotAvailable(ExecutionContext*, CallbackWrapper*); | |
79 void fileSystemNotAllowedInternal(ExecutionContext*, CallbackWrapper*); | 81 void fileSystemNotAllowedInternal(ExecutionContext*, CallbackWrapper*); |
80 void fileSystemAllowedInternal(ExecutionContext*, FileSystemType, CallbackWr
apper*); | 82 void fileSystemAllowedInternal(ExecutionContext*, FileSystemType, CallbackWr
apper*); |
81 void resolveURLInternal(ExecutionContext*, const KURL&, CallbackWrapper*); | 83 void resolveURLInternal(ExecutionContext*, const KURL&, CallbackWrapper*); |
82 void deleteFileSystemInternal(ExecutionContext*, FileSystemType, CallbackWra
pper*); | 84 void deleteFileSystemInternal(ExecutionContext*, FileSystemType, CallbackWra
pper*); |
| 85 |
83 OwnPtr<FileSystemClient> m_client; | 86 OwnPtr<FileSystemClient> m_client; |
84 }; | 87 }; |
85 | 88 |
86 } // namespace blink | 89 } // namespace blink |
87 | 90 |
88 #endif // LocalFileSystem_h | 91 #endif // LocalFileSystem_h |
OLD | NEW |