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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 Member<HelperType> m_helper; | 112 Member<HelperType> m_helper; |
113 }; | 113 }; |
114 | 114 |
115 class ErrorCallbackImpl final : public ErrorCallback { | 115 class ErrorCallbackImpl final : public ErrorCallback { |
116 public: | 116 public: |
117 static ErrorCallbackImpl* create(HelperType* helper) | 117 static ErrorCallbackImpl* create(HelperType* helper) |
118 { | 118 { |
119 return new ErrorCallbackImpl(helper); | 119 return new ErrorCallbackImpl(helper); |
120 } | 120 } |
121 | 121 |
122 void handleEvent(FileError* error) override | 122 void handleEvent(DOMException* error) override |
123 { | 123 { |
124 ASSERT(error); | 124 NOTREACHED(); |
125 m_helper->setError(error->code()); | 125 } |
| 126 |
| 127 void handleEvent(FileError::ErrorCode error) override |
| 128 { |
| 129 m_helper->setError(error); |
126 } | 130 } |
127 | 131 |
128 DEFINE_INLINE_TRACE() | 132 DEFINE_INLINE_TRACE() |
129 { | 133 { |
130 visitor->trace(m_helper); | 134 visitor->trace(m_helper); |
131 ErrorCallback::trace(visitor); | 135 ErrorCallback::trace(visitor); |
132 } | 136 } |
133 | 137 |
134 private: | 138 private: |
135 explicit ErrorCallbackImpl(HelperType* helper) | 139 explicit ErrorCallbackImpl(HelperType* helper) |
136 : m_helper(helper) | 140 : m_helper(helper) |
137 { | 141 { |
138 } | 142 } |
139 Member<HelperType> m_helper; | 143 Member<HelperType> m_helper; |
140 }; | 144 }; |
141 | 145 |
142 void setError(FileError::ErrorCode code) | 146 void setError(FileError::ErrorCode error) |
143 { | 147 { |
144 m_errorCode = code; | 148 m_errorCode = error; |
145 m_completed = true; | 149 m_completed = true; |
146 } | 150 } |
147 | 151 |
148 void setResult(CallbackArg result) | 152 void setResult(CallbackArg result) |
149 { | 153 { |
150 m_result = ResultType::create(result); | 154 m_result = ResultType::create(result); |
151 m_completed = true; | 155 m_completed = true; |
152 } | 156 } |
153 | 157 |
154 Member<ResultType> m_result; | 158 Member<ResultType> m_result; |
(...skipping 11 matching lines...) Expand all Loading... |
166 }; | 170 }; |
167 | 171 |
168 typedef SyncCallbackHelper<EntryCallback, Entry*, EntrySync> EntrySyncCallbackHe
lper; | 172 typedef SyncCallbackHelper<EntryCallback, Entry*, EntrySync> EntrySyncCallbackHe
lper; |
169 typedef SyncCallbackHelper<MetadataCallback, Metadata*, Metadata> MetadataSyncCa
llbackHelper; | 173 typedef SyncCallbackHelper<MetadataCallback, Metadata*, Metadata> MetadataSyncCa
llbackHelper; |
170 typedef SyncCallbackHelper<VoidCallback, EmptyType*, EmptyType> VoidSyncCallback
Helper; | 174 typedef SyncCallbackHelper<VoidCallback, EmptyType*, EmptyType> VoidSyncCallback
Helper; |
171 typedef SyncCallbackHelper<FileSystemCallback, DOMFileSystem*, DOMFileSystemSync
> FileSystemSyncCallbackHelper; | 175 typedef SyncCallbackHelper<FileSystemCallback, DOMFileSystem*, DOMFileSystemSync
> FileSystemSyncCallbackHelper; |
172 | 176 |
173 } // namespace blink | 177 } // namespace blink |
174 | 178 |
175 #endif // SyncCallbackHelper_h | 179 #endif // SyncCallbackHelper_h |
OLD | NEW |