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 17 matching lines...) Expand all Loading... |
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/page/Page.h" | 34 #include "core/page/Page.h" |
35 #include "core/workers/WorkerClients.h" | 35 #include "core/workers/WorkerClients.h" |
36 #include "platform/FileSystemType.h" | 36 #include "platform/FileSystemType.h" |
37 #include "wtf/Forward.h" | 37 #include "wtf/Forward.h" |
| 38 #include "wtf/Functional.h" |
38 | 39 |
39 namespace WebCore { | 40 namespace WebCore { |
40 | 41 |
41 class AsyncFileSystemCallbacks; | 42 class AsyncFileSystemCallbacks; |
| 43 class CallbackWrapper; |
42 class FileSystemClient; | 44 class FileSystemClient; |
43 class ExecutionContext; | 45 class ExecutionContext; |
44 | 46 |
45 class LocalFileSystem FINAL : public NoBaseWillBeGarbageCollectedFinalized<Local
FileSystem>, public WillBeHeapSupplement<Page>, public WillBeHeapSupplement<Work
erClients> { | 47 class LocalFileSystem FINAL : public NoBaseWillBeGarbageCollectedFinalized<Local
FileSystem>, public WillBeHeapSupplement<Page>, public WillBeHeapSupplement<Work
erClients> { |
46 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LocalFileSystem); | 48 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LocalFileSystem); |
47 WTF_MAKE_NONCOPYABLE(LocalFileSystem); | 49 WTF_MAKE_NONCOPYABLE(LocalFileSystem); |
48 public: | 50 public: |
49 static PassOwnPtrWillBeRawPtr<LocalFileSystem> create(PassOwnPtr<FileSystemC
lient>); | 51 static PassOwnPtrWillBeRawPtr<LocalFileSystem> create(PassOwnPtr<FileSystemC
lient>); |
50 virtual ~LocalFileSystem(); | 52 virtual ~LocalFileSystem(); |
51 | 53 |
52 void resolveURL(ExecutionContext*, const KURL&, PassOwnPtr<AsyncFileSystemCa
llbacks>); | 54 void resolveURL(ExecutionContext*, const KURL&, PassOwnPtr<AsyncFileSystemCa
llbacks>); |
53 void requestFileSystem(ExecutionContext*, FileSystemType, long long size, Pa
ssOwnPtr<AsyncFileSystemCallbacks>); | 55 void requestFileSystem(ExecutionContext*, FileSystemType, long long size, Pa
ssOwnPtr<AsyncFileSystemCallbacks>); |
54 void deleteFileSystem(ExecutionContext*, FileSystemType, PassOwnPtr<AsyncFil
eSystemCallbacks>); | 56 void deleteFileSystem(ExecutionContext*, FileSystemType, PassOwnPtr<AsyncFil
eSystemCallbacks>); |
55 | 57 |
56 FileSystemClient* client() { return m_client.get(); } | 58 FileSystemClient* client() { return m_client.get(); } |
57 | 59 |
58 static const char* supplementName(); | 60 static const char* supplementName(); |
59 static LocalFileSystem* from(ExecutionContext&); | 61 static LocalFileSystem* from(ExecutionContext&); |
60 | 62 |
61 virtual void trace(Visitor* visitor) OVERRIDE | 63 virtual void trace(Visitor* visitor) OVERRIDE |
62 { | 64 { |
63 WillBeHeapSupplement<Page>::trace(visitor); | 65 WillBeHeapSupplement<Page>::trace(visitor); |
64 WillBeHeapSupplement<WorkerClients>::trace(visitor); | 66 WillBeHeapSupplement<WorkerClients>::trace(visitor); |
65 } | 67 } |
66 | 68 |
67 protected: | 69 protected: |
68 explicit LocalFileSystem(PassOwnPtr<FileSystemClient>); | 70 explicit LocalFileSystem(PassOwnPtr<FileSystemClient>); |
69 | 71 |
| 72 private: |
| 73 void requestFileSystemAccessInternal(ExecutionContext*, const Closure& allow
ed, const Closure& denied); |
| 74 void fileSystemNotAllowedInternal(PassRefPtr<ExecutionContext>, PassRefPtr<C
allbackWrapper>); |
| 75 void fileSystemAllowedInternal(PassRefPtr<ExecutionContext>, FileSystemType,
PassRefPtr<CallbackWrapper>); |
| 76 void resolveURLInternal(const KURL&, PassRefPtr<CallbackWrapper>); |
| 77 void deleteFileSystemInternal(PassRefPtr<ExecutionContext>, FileSystemType,
PassRefPtr<CallbackWrapper>); |
70 OwnPtr<FileSystemClient> m_client; | 78 OwnPtr<FileSystemClient> m_client; |
71 }; | 79 }; |
72 | 80 |
73 } // namespace WebCore | 81 } // namespace WebCore |
74 | 82 |
75 #endif // LocalFileSystem_h | 83 #endif // LocalFileSystem_h |
OLD | NEW |