OLD | NEW |
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 typedef Member<ResultType> StorageType; | 56 typedef Member<ResultType> StorageType; |
57 | 57 |
58 static ReturnType createFromCallbackArg(CallbackArg argument) | 58 static ReturnType createFromCallbackArg(CallbackArg argument) |
59 { | 59 { |
60 return ResultType::create(argument); | 60 return ResultType::create(argument); |
61 } | 61 } |
62 }; | 62 }; |
63 | 63 |
64 // A helper template for FileSystemSync implementation. | 64 // A helper template for FileSystemSync implementation. |
65 template <typename SuccessCallback, typename CallbackArg, typename ResultType> | 65 template <typename SuccessCallback, typename CallbackArg, typename ResultType> |
66 class SyncCallbackHelper final : public GarbageCollected<SyncCallbackHelper<Succ
essCallback, CallbackArg, ResultType> > { | 66 class SyncCallbackHelper final : public GarbageCollected<SyncCallbackHelper<Succ
essCallback, CallbackArg, ResultType>> { |
67 public: | 67 public: |
68 typedef SyncCallbackHelper<SuccessCallback, CallbackArg, ResultType> HelperT
ype; | 68 typedef SyncCallbackHelper<SuccessCallback, CallbackArg, ResultType> HelperT
ype; |
69 typedef HelperResultType<ResultType, CallbackArg> ResultTypeTrait; | 69 typedef HelperResultType<ResultType, CallbackArg> ResultTypeTrait; |
70 typedef typename ResultTypeTrait::StorageType ResultStorageType; | 70 typedef typename ResultTypeTrait::StorageType ResultStorageType; |
71 typedef typename ResultTypeTrait::ReturnType ResultReturnType; | 71 typedef typename ResultTypeTrait::ReturnType ResultReturnType; |
72 | 72 |
73 static HelperType* create() | 73 static HelperType* create() |
74 { | 74 { |
75 return new SyncCallbackHelper(); | 75 return new SyncCallbackHelper(); |
76 } | 76 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 }; | 171 }; |
172 | 172 |
173 typedef SyncCallbackHelper<EntryCallback, Entry*, EntrySync> EntrySyncCallbackHe
lper; | 173 typedef SyncCallbackHelper<EntryCallback, Entry*, EntrySync> EntrySyncCallbackHe
lper; |
174 typedef SyncCallbackHelper<MetadataCallback, Metadata*, Metadata> MetadataSyncCa
llbackHelper; | 174 typedef SyncCallbackHelper<MetadataCallback, Metadata*, Metadata> MetadataSyncCa
llbackHelper; |
175 typedef SyncCallbackHelper<VoidCallback, EmptyType*, EmptyType> VoidSyncCallback
Helper; | 175 typedef SyncCallbackHelper<VoidCallback, EmptyType*, EmptyType> VoidSyncCallback
Helper; |
176 typedef SyncCallbackHelper<FileSystemCallback, DOMFileSystem*, DOMFileSystemSync
> FileSystemSyncCallbackHelper; | 176 typedef SyncCallbackHelper<FileSystemCallback, DOMFileSystem*, DOMFileSystemSync
> FileSystemSyncCallbackHelper; |
177 | 177 |
178 } // namespace blink | 178 } // namespace blink |
179 | 179 |
180 #endif // SyncCallbackHelper_h | 180 #endif // SyncCallbackHelper_h |
OLD | NEW |