| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 { | 94 { |
| 95 return adoptRef(new SuccessCallbackImpl(helper)); | 95 return adoptRef(new SuccessCallbackImpl(helper)); |
| 96 } | 96 } |
| 97 | 97 |
| 98 virtual bool handleEvent() | 98 virtual bool handleEvent() |
| 99 { | 99 { |
| 100 m_helper->setError(FileError::OK); | 100 m_helper->setError(FileError::OK); |
| 101 return true; | 101 return true; |
| 102 } | 102 } |
| 103 | 103 |
| 104 virtual bool handleEvent(CallbackArg* arg) | 104 virtual bool handleEvent(CallbackArg arg) |
| 105 { | 105 { |
| 106 m_helper->setResult(ResultType::create(arg)); | 106 m_helper->setResult(ResultType::create(arg)); |
| 107 return true; | 107 return true; |
| 108 } | 108 } |
| 109 | 109 |
| 110 private: | 110 private: |
| 111 explicit SuccessCallbackImpl(HelperType* helper) | 111 explicit SuccessCallbackImpl(HelperType* helper) |
| 112 : m_helper(helper) | 112 : m_helper(helper) |
| 113 { | 113 { |
| 114 } | 114 } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 167 } |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 struct EmptyObserverType { | 170 struct EmptyObserverType { |
| 171 bool waitForOperationToComplete() | 171 bool waitForOperationToComplete() |
| 172 { | 172 { |
| 173 return false; | 173 return false; |
| 174 } | 174 } |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 typedef SyncCallbackHelper<EntryCallback, AsyncFileSystem, Entry, EntrySync> Ent
rySyncCallbackHelper; | 177 typedef SyncCallbackHelper<EntryCallback, AsyncFileSystem, Entry*, EntrySync> En
trySyncCallbackHelper; |
| 178 typedef SyncCallbackHelper<EntriesCallback, AsyncFileSystem, EntryArray, EntryAr
raySync> EntriesSyncCallbackHelper; | 178 typedef SyncCallbackHelper<EntriesCallback, AsyncFileSystem, const EntryVector&,
EntryArraySync> EntriesSyncCallbackHelper; |
| 179 typedef SyncCallbackHelper<MetadataCallback, AsyncFileSystem, Metadata, Metadata
> MetadataSyncCallbackHelper; | 179 typedef SyncCallbackHelper<MetadataCallback, AsyncFileSystem, Metadata*, Metadat
a> MetadataSyncCallbackHelper; |
| 180 typedef SyncCallbackHelper<VoidCallback, AsyncFileSystem, EmptyType, EmptyType>
VoidSyncCallbackHelper; | 180 typedef SyncCallbackHelper<VoidCallback, AsyncFileSystem, EmptyType*, EmptyType>
VoidSyncCallbackHelper; |
| 181 typedef SyncCallbackHelper<FileSystemCallback, EmptyObserverType, DOMFileSystem,
DOMFileSystemSync> FileSystemSyncCallbackHelper; | 181 typedef SyncCallbackHelper<FileSystemCallback, EmptyObserverType, DOMFileSystem*
, DOMFileSystemSync> FileSystemSyncCallbackHelper; |
| 182 | 182 |
| 183 } // namespace WebCore | 183 } // namespace WebCore |
| 184 | 184 |
| 185 #endif // SyncCallbackHelper_h | 185 #endif // SyncCallbackHelper_h |
| OLD | NEW |