Chromium Code Reviews| 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; |
| 42 class FileSystemClient; | 43 class FileSystemClient; |
| 43 class ExecutionContext; | 44 class ExecutionContext; |
| 44 | 45 |
| 46 struct RefCountedFileSystemCallbacks : RefCounted<RefCountedFileSystemCallbacks> { | |
|
kinuko
2014/05/22 10:37:42
This can be hidden in .cpp file.
Xi Han
2014/05/22 14:21:41
Done.
| |
| 47 RefCountedFileSystemCallbacks(PassOwnPtr<AsyncFileSystemCallbacks> callbacks ) | |
| 48 : callbacks(callbacks) { } | |
| 49 PassOwnPtr<AsyncFileSystemCallbacks> callbacks; | |
|
kinuko
2014/05/22 10:37:42
Usually we don't use PassOwnPtr for storage type
Xi Han
2014/05/22 14:21:41
Oh, I see, great catch, thanks.
| |
| 50 }; | |
| 51 | |
| 45 class LocalFileSystem FINAL : public NoBaseWillBeGarbageCollectedFinalized<Local FileSystem>, public WillBeHeapSupplement<Page>, public WillBeHeapSupplement<Work erClients> { | 52 class LocalFileSystem FINAL : public NoBaseWillBeGarbageCollectedFinalized<Local FileSystem>, public WillBeHeapSupplement<Page>, public WillBeHeapSupplement<Work erClients> { |
| 46 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LocalFileSystem); | 53 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LocalFileSystem); |
| 47 WTF_MAKE_NONCOPYABLE(LocalFileSystem); | 54 WTF_MAKE_NONCOPYABLE(LocalFileSystem); |
| 48 public: | 55 public: |
| 49 static PassOwnPtrWillBeRawPtr<LocalFileSystem> create(PassOwnPtr<FileSystemC lient>); | 56 static PassOwnPtrWillBeRawPtr<LocalFileSystem> create(PassOwnPtr<FileSystemC lient>); |
| 50 virtual ~LocalFileSystem(); | 57 virtual ~LocalFileSystem(); |
| 51 | 58 |
| 52 void resolveURL(ExecutionContext*, const KURL&, PassOwnPtr<AsyncFileSystemCa llbacks>); | 59 void resolveURL(ExecutionContext*, const KURL&, PassOwnPtr<AsyncFileSystemCa llbacks>); |
| 53 void requestFileSystem(ExecutionContext*, FileSystemType, long long size, Pa ssOwnPtr<AsyncFileSystemCallbacks>); | 60 void requestFileSystem(ExecutionContext*, FileSystemType, long long size, Pa ssOwnPtr<AsyncFileSystemCallbacks>); |
| 54 void deleteFileSystem(ExecutionContext*, FileSystemType, PassOwnPtr<AsyncFil eSystemCallbacks>); | 61 void deleteFileSystem(ExecutionContext*, FileSystemType, PassOwnPtr<AsyncFil eSystemCallbacks>); |
| 55 | 62 |
| 56 FileSystemClient* client() { return m_client.get(); } | 63 FileSystemClient* client() { return m_client.get(); } |
| 57 | 64 |
| 58 static const char* supplementName(); | 65 static const char* supplementName(); |
| 59 static LocalFileSystem* from(ExecutionContext&); | 66 static LocalFileSystem* from(ExecutionContext&); |
| 60 | 67 |
| 61 virtual void trace(Visitor* visitor) OVERRIDE | 68 virtual void trace(Visitor* visitor) OVERRIDE |
| 62 { | 69 { |
| 63 WillBeHeapSupplement<Page>::trace(visitor); | 70 WillBeHeapSupplement<Page>::trace(visitor); |
| 64 WillBeHeapSupplement<WorkerClients>::trace(visitor); | 71 WillBeHeapSupplement<WorkerClients>::trace(visitor); |
| 65 } | 72 } |
| 66 | |
| 67 protected: | 73 protected: |
| 68 explicit LocalFileSystem(PassOwnPtr<FileSystemClient>); | 74 explicit LocalFileSystem(PassOwnPtr<FileSystemClient>); |
| 69 | 75 private: |
| 76 void fileSystemNotAllowedInternal(PassRefPtr<ExecutionContext>, PassRefPtr<R efCountedFileSystemCallbacks>); | |
| 77 void fileSystemAllowedInternal(PassRefPtr<ExecutionContext>, FileSystemType, PassRefPtr<RefCountedFileSystemCallbacks>); | |
| 78 void resolveURLInternal(const KURL&, PassRefPtr<RefCountedFileSystemCallback s>); | |
| 79 void deleteFileSystemInternal(PassRefPtr<ExecutionContext>, FileSystemType, PassRefPtr<RefCountedFileSystemCallbacks>); | |
| 80 void requestFileSystemAccesssAsyncInternal(PassRefPtr<ExecutionContext>, con st Closure&, const Closure&); | |
| 70 OwnPtr<FileSystemClient> m_client; | 81 OwnPtr<FileSystemClient> m_client; |
| 71 }; | 82 }; |
| 72 | 83 |
| 73 } // namespace WebCore | 84 } // namespace WebCore |
| 74 | 85 |
| 75 #endif // LocalFileSystem_h | 86 #endif // LocalFileSystem_h |
| OLD | NEW |