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

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

Issue 2297043002: Web expose FileSystemFileEntry, FileSystemDirectoryEntry and friends (Closed)
Patch Set: Rebased Created 4 years 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 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 17 matching lines...) Expand all
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 #ifndef SyncCallbackHelper_h 32 #ifndef SyncCallbackHelper_h
33 #define SyncCallbackHelper_h 33 #define SyncCallbackHelper_h
34 34
35 #include "bindings/core/v8/ExceptionState.h" 35 #include "bindings/core/v8/ExceptionState.h"
36 #include "core/fileapi/FileError.h" 36 #include "core/fileapi/FileError.h"
37 #include "core/html/VoidCallback.h" 37 #include "core/html/VoidCallback.h"
38 #include "modules/filesystem/DirectoryEntry.h"
39 #include "modules/filesystem/EntriesCallback.h"
40 #include "modules/filesystem/EntryCallback.h"
41 #include "modules/filesystem/EntrySync.h"
42 #include "modules/filesystem/FileEntry.h"
43 #include "modules/filesystem/FileSystemCallback.h" 38 #include "modules/filesystem/FileSystemCallback.h"
44 #include "modules/filesystem/FileSystemCallbacks.h" 39 #include "modules/filesystem/FileSystemCallbacks.h"
45 #include "modules/filesystem/MetadataCallback.h" 40 #include "modules/filesystem/FileSystemDirectoryEntry.h"
41 #include "modules/filesystem/FileSystemEntriesCallback.h"
42 #include "modules/filesystem/FileSystemEntryCallback.h"
43 #include "modules/filesystem/FileSystemEntrySync.h"
44 #include "modules/filesystem/FileSystemFileEntry.h"
45 #include "modules/filesystem/FileSystemMetadataCallback.h"
46 #include "platform/heap/Handle.h" 46 #include "platform/heap/Handle.h"
47 47
48 namespace blink { 48 namespace blink {
49 49
50 // A helper template for FileSystemSync implementation. 50 // A helper template for FileSystemSync implementation.
51 template <typename SuccessCallback, typename CallbackArg, typename ResultType> 51 template <typename SuccessCallback, typename CallbackArg, typename ResultType>
52 class SyncCallbackHelper final 52 class SyncCallbackHelper final
53 : public GarbageCollected< 53 : public GarbageCollected<
54 SyncCallbackHelper<SuccessCallback, CallbackArg, ResultType>> { 54 SyncCallbackHelper<SuccessCallback, CallbackArg, ResultType>> {
55 public: 55 public:
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 FileError::ErrorCode m_errorCode; 131 FileError::ErrorCode m_errorCode;
132 bool m_completed; 132 bool m_completed;
133 }; 133 };
134 134
135 struct EmptyType : public GarbageCollected<EmptyType> { 135 struct EmptyType : public GarbageCollected<EmptyType> {
136 static EmptyType* create(EmptyType*) { return 0; } 136 static EmptyType* create(EmptyType*) { return 0; }
137 137
138 DEFINE_INLINE_TRACE() {} 138 DEFINE_INLINE_TRACE() {}
139 }; 139 };
140 140
141 typedef SyncCallbackHelper<EntryCallback, Entry*, EntrySync> 141 typedef SyncCallbackHelper<FileSystemEntryCallback,
142 FileSystemEntry*,
143 FileSystemEntrySync>
142 EntrySyncCallbackHelper; 144 EntrySyncCallbackHelper;
143 typedef SyncCallbackHelper<MetadataCallback, Metadata*, Metadata> 145 typedef SyncCallbackHelper<FileSystemMetadataCallback,
146 FileSystemMetadata*,
147 FileSystemMetadata>
144 MetadataSyncCallbackHelper; 148 MetadataSyncCallbackHelper;
145 typedef SyncCallbackHelper<VoidCallback, EmptyType*, EmptyType> 149 typedef SyncCallbackHelper<VoidCallback, EmptyType*, EmptyType>
146 VoidSyncCallbackHelper; 150 VoidSyncCallbackHelper;
147 typedef SyncCallbackHelper<FileSystemCallback, 151 typedef SyncCallbackHelper<FileSystemCallback, FileSystem*, FileSystemSync>
148 DOMFileSystem*,
149 DOMFileSystemSync>
150 FileSystemSyncCallbackHelper; 152 FileSystemSyncCallbackHelper;
151 153
152 } // namespace blink 154 } // namespace blink
153 155
154 #endif // SyncCallbackHelper_h 156 #endif // SyncCallbackHelper_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698