Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: Source/modules/filesystem/LocalFileSystem.h

Issue 277353002: Use asynchronized api for file system request. [blink] (3/4) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Apply Kinuko's patch. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/modules/filesystem/FileSystemClient.h ('k') | Source/modules/filesystem/LocalFileSystem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698