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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 class FileWriterBaseCallback; | 51 class FileWriterBaseCallback; |
52 class MetadataCallback; | 52 class MetadataCallback; |
53 class ExecutionContext; | 53 class ExecutionContext; |
54 class VoidCallback; | 54 class VoidCallback; |
55 | 55 |
56 class FileSystemCallbacksBase : public AsyncFileSystemCallbacks { | 56 class FileSystemCallbacksBase : public AsyncFileSystemCallbacks { |
57 public: | 57 public: |
58 virtual ~FileSystemCallbacksBase(); | 58 virtual ~FileSystemCallbacksBase(); |
59 | 59 |
60 // For ErrorCallback. | 60 // For ErrorCallback. |
61 virtual void didFail(int code) OVERRIDE FINAL; | 61 virtual void didFail(int code) override final; |
62 | 62 |
63 // Other callback methods are implemented by each subclass. | 63 // Other callback methods are implemented by each subclass. |
64 | 64 |
65 protected: | 65 protected: |
66 FileSystemCallbacksBase(ErrorCallback*, DOMFileSystemBase*, ExecutionContext
*); | 66 FileSystemCallbacksBase(ErrorCallback*, DOMFileSystemBase*, ExecutionContext
*); |
67 | 67 |
68 bool shouldScheduleCallback() const; | 68 bool shouldScheduleCallback() const; |
69 | 69 |
70 #if !ENABLE(OILPAN) | 70 #if !ENABLE(OILPAN) |
71 template <typename CB, typename CBArg> | 71 template <typename CB, typename CBArg> |
(...skipping 10 matching lines...) Expand all Loading... |
82 void handleEventOrScheduleCallback(RawPtr<CB>); | 82 void handleEventOrScheduleCallback(RawPtr<CB>); |
83 | 83 |
84 Persistent<ErrorCallback> m_errorCallback; | 84 Persistent<ErrorCallback> m_errorCallback; |
85 Persistent<DOMFileSystemBase> m_fileSystem; | 85 Persistent<DOMFileSystemBase> m_fileSystem; |
86 RefPtrWillBePersistent<ExecutionContext> m_executionContext; | 86 RefPtrWillBePersistent<ExecutionContext> m_executionContext; |
87 int m_asyncOperationId; | 87 int m_asyncOperationId; |
88 }; | 88 }; |
89 | 89 |
90 // Subclasses ---------------------------------------------------------------- | 90 // Subclasses ---------------------------------------------------------------- |
91 | 91 |
92 class EntryCallbacks FINAL : public FileSystemCallbacksBase { | 92 class EntryCallbacks final : public FileSystemCallbacksBase { |
93 public: | 93 public: |
94 static PassOwnPtr<AsyncFileSystemCallbacks> create(EntryCallback*, ErrorCall
back*, ExecutionContext*, DOMFileSystemBase*, const String& expectedPath, bool i
sDirectory); | 94 static PassOwnPtr<AsyncFileSystemCallbacks> create(EntryCallback*, ErrorCall
back*, ExecutionContext*, DOMFileSystemBase*, const String& expectedPath, bool i
sDirectory); |
95 virtual void didSucceed() OVERRIDE; | 95 virtual void didSucceed() override; |
96 | 96 |
97 private: | 97 private: |
98 EntryCallbacks(EntryCallback*, ErrorCallback*, ExecutionContext*, DOMFileSys
temBase*, const String& expectedPath, bool isDirectory); | 98 EntryCallbacks(EntryCallback*, ErrorCallback*, ExecutionContext*, DOMFileSys
temBase*, const String& expectedPath, bool isDirectory); |
99 Persistent<EntryCallback> m_successCallback; | 99 Persistent<EntryCallback> m_successCallback; |
100 String m_expectedPath; | 100 String m_expectedPath; |
101 bool m_isDirectory; | 101 bool m_isDirectory; |
102 }; | 102 }; |
103 | 103 |
104 class EntriesCallbacks FINAL : public FileSystemCallbacksBase { | 104 class EntriesCallbacks final : public FileSystemCallbacksBase { |
105 public: | 105 public: |
106 static PassOwnPtr<AsyncFileSystemCallbacks> create(EntriesCallback*, ErrorCa
llback*, ExecutionContext*, DirectoryReaderBase*, const String& basePath); | 106 static PassOwnPtr<AsyncFileSystemCallbacks> create(EntriesCallback*, ErrorCa
llback*, ExecutionContext*, DirectoryReaderBase*, const String& basePath); |
107 virtual void didReadDirectoryEntry(const String& name, bool isDirectory) OVE
RRIDE; | 107 virtual void didReadDirectoryEntry(const String& name, bool isDirectory) ove
rride; |
108 virtual void didReadDirectoryEntries(bool hasMore) OVERRIDE; | 108 virtual void didReadDirectoryEntries(bool hasMore) override; |
109 | 109 |
110 private: | 110 private: |
111 EntriesCallbacks(EntriesCallback*, ErrorCallback*, ExecutionContext*, Direct
oryReaderBase*, const String& basePath); | 111 EntriesCallbacks(EntriesCallback*, ErrorCallback*, ExecutionContext*, Direct
oryReaderBase*, const String& basePath); |
112 Persistent<EntriesCallback> m_successCallback; | 112 Persistent<EntriesCallback> m_successCallback; |
113 Persistent<DirectoryReaderBase> m_directoryReader; | 113 Persistent<DirectoryReaderBase> m_directoryReader; |
114 String m_basePath; | 114 String m_basePath; |
115 PersistentHeapVector<Member<Entry> > m_entries; | 115 PersistentHeapVector<Member<Entry> > m_entries; |
116 }; | 116 }; |
117 | 117 |
118 class FileSystemCallbacks FINAL : public FileSystemCallbacksBase { | 118 class FileSystemCallbacks final : public FileSystemCallbacksBase { |
119 public: | 119 public: |
120 static PassOwnPtr<AsyncFileSystemCallbacks> create(FileSystemCallback*, Erro
rCallback*, ExecutionContext*, FileSystemType); | 120 static PassOwnPtr<AsyncFileSystemCallbacks> create(FileSystemCallback*, Erro
rCallback*, ExecutionContext*, FileSystemType); |
121 virtual void didOpenFileSystem(const String& name, const KURL& rootURL) OVER
RIDE; | 121 virtual void didOpenFileSystem(const String& name, const KURL& rootURL) over
ride; |
122 | 122 |
123 private: | 123 private: |
124 FileSystemCallbacks(FileSystemCallback*, ErrorCallback*, ExecutionContext*,
FileSystemType); | 124 FileSystemCallbacks(FileSystemCallback*, ErrorCallback*, ExecutionContext*,
FileSystemType); |
125 Persistent<FileSystemCallback> m_successCallback; | 125 Persistent<FileSystemCallback> m_successCallback; |
126 FileSystemType m_type; | 126 FileSystemType m_type; |
127 }; | 127 }; |
128 | 128 |
129 class ResolveURICallbacks FINAL : public FileSystemCallbacksBase { | 129 class ResolveURICallbacks final : public FileSystemCallbacksBase { |
130 public: | 130 public: |
131 static PassOwnPtr<AsyncFileSystemCallbacks> create(EntryCallback*, ErrorCall
back*, ExecutionContext*); | 131 static PassOwnPtr<AsyncFileSystemCallbacks> create(EntryCallback*, ErrorCall
back*, ExecutionContext*); |
132 virtual void didResolveURL(const String& name, const KURL& rootURL, FileSyst
emType, const String& filePath, bool isDirectry) OVERRIDE; | 132 virtual void didResolveURL(const String& name, const KURL& rootURL, FileSyst
emType, const String& filePath, bool isDirectry) override; |
133 | 133 |
134 private: | 134 private: |
135 ResolveURICallbacks(EntryCallback*, ErrorCallback*, ExecutionContext*); | 135 ResolveURICallbacks(EntryCallback*, ErrorCallback*, ExecutionContext*); |
136 Persistent<EntryCallback> m_successCallback; | 136 Persistent<EntryCallback> m_successCallback; |
137 }; | 137 }; |
138 | 138 |
139 class MetadataCallbacks FINAL : public FileSystemCallbacksBase { | 139 class MetadataCallbacks final : public FileSystemCallbacksBase { |
140 public: | 140 public: |
141 static PassOwnPtr<AsyncFileSystemCallbacks> create(MetadataCallback*, ErrorC
allback*, ExecutionContext*, DOMFileSystemBase*); | 141 static PassOwnPtr<AsyncFileSystemCallbacks> create(MetadataCallback*, ErrorC
allback*, ExecutionContext*, DOMFileSystemBase*); |
142 virtual void didReadMetadata(const FileMetadata&) OVERRIDE; | 142 virtual void didReadMetadata(const FileMetadata&) override; |
143 | 143 |
144 private: | 144 private: |
145 MetadataCallbacks(MetadataCallback*, ErrorCallback*, ExecutionContext*, DOMF
ileSystemBase*); | 145 MetadataCallbacks(MetadataCallback*, ErrorCallback*, ExecutionContext*, DOMF
ileSystemBase*); |
146 Persistent<MetadataCallback> m_successCallback; | 146 Persistent<MetadataCallback> m_successCallback; |
147 }; | 147 }; |
148 | 148 |
149 class FileWriterBaseCallbacks FINAL : public FileSystemCallbacksBase { | 149 class FileWriterBaseCallbacks final : public FileSystemCallbacksBase { |
150 public: | 150 public: |
151 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtrWillBeRawPtr<Fi
leWriterBase>, FileWriterBaseCallback*, ErrorCallback*, ExecutionContext*); | 151 static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtrWillBeRawPtr<Fi
leWriterBase>, FileWriterBaseCallback*, ErrorCallback*, ExecutionContext*); |
152 virtual void didCreateFileWriter(PassOwnPtr<WebFileWriter>, long long length
) OVERRIDE; | 152 virtual void didCreateFileWriter(PassOwnPtr<WebFileWriter>, long long length
) override; |
153 | 153 |
154 private: | 154 private: |
155 FileWriterBaseCallbacks(PassRefPtrWillBeRawPtr<FileWriterBase>, FileWriterBa
seCallback*, ErrorCallback*, ExecutionContext*); | 155 FileWriterBaseCallbacks(PassRefPtrWillBeRawPtr<FileWriterBase>, FileWriterBa
seCallback*, ErrorCallback*, ExecutionContext*); |
156 Persistent<FileWriterBase> m_fileWriter; | 156 Persistent<FileWriterBase> m_fileWriter; |
157 Persistent<FileWriterBaseCallback> m_successCallback; | 157 Persistent<FileWriterBaseCallback> m_successCallback; |
158 }; | 158 }; |
159 | 159 |
160 class SnapshotFileCallback FINAL : public FileSystemCallbacksBase { | 160 class SnapshotFileCallback final : public FileSystemCallbacksBase { |
161 public: | 161 public: |
162 static PassOwnPtr<AsyncFileSystemCallbacks> create(DOMFileSystemBase*, const
String& name, const KURL&, FileCallback*, ErrorCallback*, ExecutionContext*); | 162 static PassOwnPtr<AsyncFileSystemCallbacks> create(DOMFileSystemBase*, const
String& name, const KURL&, FileCallback*, ErrorCallback*, ExecutionContext*); |
163 virtual void didCreateSnapshotFile(const FileMetadata&, PassRefPtr<BlobDataH
andle> snapshot); | 163 virtual void didCreateSnapshotFile(const FileMetadata&, PassRefPtr<BlobDataH
andle> snapshot); |
164 | 164 |
165 private: | 165 private: |
166 SnapshotFileCallback(DOMFileSystemBase*, const String& name, const KURL&, Fi
leCallback*, ErrorCallback*, ExecutionContext*); | 166 SnapshotFileCallback(DOMFileSystemBase*, const String& name, const KURL&, Fi
leCallback*, ErrorCallback*, ExecutionContext*); |
167 String m_name; | 167 String m_name; |
168 KURL m_url; | 168 KURL m_url; |
169 Persistent<FileCallback> m_successCallback; | 169 Persistent<FileCallback> m_successCallback; |
170 }; | 170 }; |
171 | 171 |
172 class VoidCallbacks FINAL : public FileSystemCallbacksBase { | 172 class VoidCallbacks final : public FileSystemCallbacksBase { |
173 public: | 173 public: |
174 static PassOwnPtr<AsyncFileSystemCallbacks> create(VoidCallback*, ErrorCallb
ack*, ExecutionContext*, DOMFileSystemBase*); | 174 static PassOwnPtr<AsyncFileSystemCallbacks> create(VoidCallback*, ErrorCallb
ack*, ExecutionContext*, DOMFileSystemBase*); |
175 virtual void didSucceed() OVERRIDE; | 175 virtual void didSucceed() override; |
176 | 176 |
177 private: | 177 private: |
178 VoidCallbacks(VoidCallback*, ErrorCallback*, ExecutionContext*, DOMFileSyste
mBase*); | 178 VoidCallbacks(VoidCallback*, ErrorCallback*, ExecutionContext*, DOMFileSyste
mBase*); |
179 Persistent<VoidCallback> m_successCallback; | 179 Persistent<VoidCallback> m_successCallback; |
180 }; | 180 }; |
181 | 181 |
182 } // namespace blink | 182 } // namespace blink |
183 | 183 |
184 #endif // FileSystemCallbacks_h | 184 #endif // FileSystemCallbacks_h |
OLD | NEW |