| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 Member<FileWriterCallback> m_callback; | 152 Member<FileWriterCallback> m_callback; |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 } // namespace | 155 } // namespace |
| 156 | 156 |
| 157 void DOMFileSystem::createWriter(const FileEntry* fileEntry, FileWriterCallback*
successCallback, ErrorCallbackBase* errorCallback) | 157 void DOMFileSystem::createWriter(const FileEntry* fileEntry, FileWriterCallback*
successCallback, ErrorCallbackBase* errorCallback) |
| 158 { | 158 { |
| 159 ASSERT(fileEntry); | 159 ASSERT(fileEntry); |
| 160 | 160 |
| 161 if (!fileSystem()) { | 161 if (!fileSystem()) { |
| 162 reportError(errorCallback, FileError::ABORT_ERR); | 162 reportError(errorCallback, FileError::kAbortErr); |
| 163 return; | 163 return; |
| 164 } | 164 } |
| 165 | 165 |
| 166 FileWriter* fileWriter = FileWriter::create(getExecutionContext()); | 166 FileWriter* fileWriter = FileWriter::create(getExecutionContext()); |
| 167 FileWriterBaseCallback* conversionCallback = ConvertToFileWriterCallback::cr
eate(successCallback); | 167 FileWriterBaseCallback* conversionCallback = ConvertToFileWriterCallback::cr
eate(successCallback); |
| 168 std::unique_ptr<AsyncFileSystemCallbacks> callbacks = FileWriterBaseCallback
s::create(fileWriter, conversionCallback, errorCallback, m_context); | 168 std::unique_ptr<AsyncFileSystemCallbacks> callbacks = FileWriterBaseCallback
s::create(fileWriter, conversionCallback, errorCallback, m_context); |
| 169 fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter, s
td::move(callbacks)); | 169 fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter, s
td::move(callbacks)); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void DOMFileSystem::createFile(const FileEntry* fileEntry, BlobCallback* success
Callback, ErrorCallbackBase* errorCallback) | 172 void DOMFileSystem::createFile(const FileEntry* fileEntry, BlobCallback* success
Callback, ErrorCallbackBase* errorCallback) |
| 173 { | 173 { |
| 174 KURL fileSystemURL = createFileSystemURL(fileEntry); | 174 KURL fileSystemURL = createFileSystemURL(fileEntry); |
| 175 if (!fileSystem()) { | 175 if (!fileSystem()) { |
| 176 reportError(errorCallback, FileError::ABORT_ERR); | 176 reportError(errorCallback, FileError::kAbortErr); |
| 177 return; | 177 return; |
| 178 } | 178 } |
| 179 | 179 |
| 180 fileSystem()->createSnapshotFileAndReadMetadata(fileSystemURL, SnapshotFileC
allback::create(this, fileEntry->name(), fileSystemURL, successCallback, errorCa
llback, m_context)); | 180 fileSystem()->createSnapshotFileAndReadMetadata(fileSystemURL, SnapshotFileC
allback::create(this, fileEntry->name(), fileSystemURL, successCallback, errorCa
llback, m_context)); |
| 181 } | 181 } |
| 182 | 182 |
| 183 DEFINE_TRACE(DOMFileSystem) | 183 DEFINE_TRACE(DOMFileSystem) |
| 184 { | 184 { |
| 185 DOMFileSystemBase::trace(visitor); | 185 DOMFileSystemBase::trace(visitor); |
| 186 ActiveDOMObject::trace(visitor); | 186 ActiveDOMObject::trace(visitor); |
| 187 visitor->trace(m_rootEntry); | 187 visitor->trace(m_rootEntry); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace blink | 190 } // namespace blink |
| OLD | NEW |