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

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

Issue 2645613004: Provide a per-supplement implementation of LocalFileSystem.
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 13 matching lines...) Expand all
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"
35 #include "core/workers/WorkerClients.h"
36 #include "platform/FileSystemType.h" 34 #include "platform/FileSystemType.h"
37 #include "platform/Supplementable.h"
38 #include "platform/heap/Handle.h"
39 #include "wtf/Forward.h" 35 #include "wtf/Forward.h"
40 #include "wtf/Functional.h" 36 #include "wtf/Functional.h"
41 #include <memory> 37 #include <memory>
42 38
43 namespace blink { 39 namespace blink {
44 40
45 class AsyncFileSystemCallbacks; 41 class AsyncFileSystemCallbacks;
46 class CallbackWrapper; 42 class CallbackWrapper;
47 class FileSystemClient; 43 class FileSystemClient;
48 class ExecutionContext; 44 class ExecutionContext;
49 class KURL; 45 class KURL;
50 class WebFileSystem; 46 class WebFileSystem;
51 47
52 class LocalFileSystem final : public GarbageCollectedFinalized<LocalFileSystem>, 48 class LocalFileSystem {
53 public Supplement<LocalFrame>,
54 public Supplement<WorkerClients> {
55 USING_GARBAGE_COLLECTED_MIXIN(LocalFileSystem);
56 WTF_MAKE_NONCOPYABLE(LocalFileSystem); 49 WTF_MAKE_NONCOPYABLE(LocalFileSystem);
57 50
58 public: 51 public:
59 LocalFileSystem(LocalFrame&, std::unique_ptr<FileSystemClient>); 52 virtual ~LocalFileSystem();
60 LocalFileSystem(WorkerClients&, std::unique_ptr<FileSystemClient>);
61 ~LocalFileSystem();
62 53
63 void resolveURL(ExecutionContext*, 54 virtual void resolveURL(ExecutionContext*,
64 const KURL&, 55 const KURL&,
65 std::unique_ptr<AsyncFileSystemCallbacks>); 56 std::unique_ptr<AsyncFileSystemCallbacks>) = 0;
66 void requestFileSystem(ExecutionContext*, 57 virtual void requestFileSystem(ExecutionContext*,
67 FileSystemType, 58 FileSystemType,
68 long long size, 59 long long size,
69 std::unique_ptr<AsyncFileSystemCallbacks>); 60 std::unique_ptr<AsyncFileSystemCallbacks>) = 0;
70
71 FileSystemClient* client() const { return m_client.get(); }
72 61
73 static const char* supplementName(); 62 static const char* supplementName();
74 static LocalFileSystem* from(ExecutionContext&); 63 static LocalFileSystem* from(ExecutionContext&);
75 64
76 DECLARE_VIRTUAL_TRACE(); 65 protected:
77 66 explicit LocalFileSystem(std::unique_ptr<FileSystemClient>);
78 private:
79 WebFileSystem* getFileSystem() const;
80 void fileSystemNotAvailable(ExecutionContext*, CallbackWrapper*);
81 67
82 void requestFileSystemAccessInternal(ExecutionContext*, 68 void requestFileSystemAccessInternal(ExecutionContext*,
83 std::unique_ptr<WTF::Closure> allowed, 69 std::unique_ptr<WTF::Closure> allowed,
84 std::unique_ptr<WTF::Closure> denied); 70 std::unique_ptr<WTF::Closure> denied);
85 void fileSystemNotAllowedInternal(ExecutionContext*, CallbackWrapper*); 71 void fileSystemNotAllowedInternal(ExecutionContext*, CallbackWrapper*);
86 void fileSystemAllowedInternal(ExecutionContext*, 72 void fileSystemAllowedInternal(ExecutionContext*,
87 FileSystemType, 73 FileSystemType,
88 CallbackWrapper*); 74 CallbackWrapper*);
89 void resolveURLInternal(ExecutionContext*, const KURL&, CallbackWrapper*); 75 void resolveURLInternal(ExecutionContext*, const KURL&, CallbackWrapper*);
90 76
77 private:
78 FileSystemClient* client() const { return m_client.get(); }
79
80 WebFileSystem* getFileSystem() const;
81 void fileSystemNotAvailable(ExecutionContext*, CallbackWrapper*);
82
91 std::unique_ptr<FileSystemClient> m_client; 83 std::unique_ptr<FileSystemClient> m_client;
92 }; 84 };
93 85
94 } // namespace blink 86 } // namespace blink
95 87
96 #endif // LocalFileSystem_h 88 #endif // LocalFileSystem_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698