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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 private: | 196 private: |
197 explicit LocalErrorCallback(FileError::ErrorCode& errorCode) | 197 explicit LocalErrorCallback(FileError::ErrorCode& errorCode) |
198 : m_errorCode(errorCode) | 198 : m_errorCode(errorCode) |
199 { | 199 { |
200 } | 200 } |
201 | 201 |
202 FileError::ErrorCode& m_errorCode; | 202 FileError::ErrorCode& m_errorCode; |
203 }; | 203 }; |
204 | 204 |
205 } | 205 } // namespace |
206 | 206 |
207 FileWriterSync* DOMFileSystemSync::createWriter(const FileEntrySync* fileEntry,
ExceptionState& exceptionState) | 207 FileWriterSync* DOMFileSystemSync::createWriter(const FileEntrySync* fileEntry,
ExceptionState& exceptionState) |
208 { | 208 { |
209 ASSERT(fileEntry); | 209 ASSERT(fileEntry); |
210 | 210 |
211 FileWriterSync* fileWriter = FileWriterSync::create(); | 211 FileWriterSync* fileWriter = FileWriterSync::create(); |
212 ReceiveFileWriterCallback* successCallback = ReceiveFileWriterCallback::crea
te(); | 212 ReceiveFileWriterCallback* successCallback = ReceiveFileWriterCallback::crea
te(); |
213 FileError::ErrorCode errorCode = FileError::OK; | 213 FileError::ErrorCode errorCode = FileError::OK; |
214 LocalErrorCallback* errorCallback = LocalErrorCallback::create(errorCode); | 214 LocalErrorCallback* errorCallback = LocalErrorCallback::create(errorCode); |
215 | 215 |
216 OwnPtr<AsyncFileSystemCallbacks> callbacks = FileWriterBaseCallbacks::create
(fileWriter, successCallback, errorCallback, m_context); | 216 OwnPtr<AsyncFileSystemCallbacks> callbacks = FileWriterBaseCallbacks::create
(fileWriter, successCallback, errorCallback, m_context); |
217 callbacks->setShouldBlockUntilCompletion(true); | 217 callbacks->setShouldBlockUntilCompletion(true); |
218 | 218 |
219 fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter, c
allbacks.release()); | 219 fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter, c
allbacks.release()); |
220 if (errorCode != FileError::OK) { | 220 if (errorCode != FileError::OK) { |
221 FileError::throwDOMException(exceptionState, errorCode); | 221 FileError::throwDOMException(exceptionState, errorCode); |
222 return 0; | 222 return 0; |
223 } | 223 } |
224 return fileWriter; | 224 return fileWriter; |
225 } | 225 } |
226 | 226 |
227 DEFINE_TRACE(DOMFileSystemSync) | 227 DEFINE_TRACE(DOMFileSystemSync) |
228 { | 228 { |
229 DOMFileSystemBase::trace(visitor); | 229 DOMFileSystemBase::trace(visitor); |
230 visitor->trace(m_rootEntry); | 230 visitor->trace(m_rootEntry); |
231 } | 231 } |
232 | 232 |
233 } | 233 } // namespace blink |
OLD | NEW |