| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 }; | 157 }; |
| 158 | 158 |
| 159 } // namespace | 159 } // namespace |
| 160 | 160 |
| 161 PassRefPtr<File> DOMFileSystemSync::createFile(const FileEntrySync* fileEntry, E
xceptionState& es) | 161 PassRefPtr<File> DOMFileSystemSync::createFile(const FileEntrySync* fileEntry, E
xceptionState& es) |
| 162 { | 162 { |
| 163 KURL fileSystemURL = createFileSystemURL(fileEntry); | 163 KURL fileSystemURL = createFileSystemURL(fileEntry); |
| 164 RefPtr<CreateFileHelper::CreateFileResult> result(CreateFileHelper::CreateFi
leResult::create()); | 164 RefPtr<CreateFileHelper::CreateFileResult> result(CreateFileHelper::CreateFi
leResult::create()); |
| 165 fileSystem()->createSnapshotFileAndReadMetadata(fileSystemURL, CreateFileHel
per::create(result, fileEntry->name(), fileSystemURL, type())); | 165 fileSystem()->createSnapshotFileAndReadMetadata(fileSystemURL, CreateFileHel
per::create(result, fileEntry->name(), fileSystemURL, type())); |
| 166 if (result->m_failed) { | 166 if (result->m_failed) { |
| 167 es.throwDOMException(result->m_code); | 167 es.throwUninformativeAndGenericDOMException(result->m_code); |
| 168 return 0; | 168 return 0; |
| 169 } | 169 } |
| 170 return result->m_file; | 170 return result->m_file; |
| 171 } | 171 } |
| 172 | 172 |
| 173 namespace { | 173 namespace { |
| 174 | 174 |
| 175 class ReceiveFileWriterCallback : public FileWriterBaseCallback { | 175 class ReceiveFileWriterCallback : public FileWriterBaseCallback { |
| 176 public: | 176 public: |
| 177 static PassRefPtr<ReceiveFileWriterCallback> create() | 177 static PassRefPtr<ReceiveFileWriterCallback> create() |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 if (errorCode) | 254 if (errorCode) |
| 255 FileError::throwDOMException(es, errorCode); | 255 FileError::throwDOMException(es, errorCode); |
| 256 return 0; | 256 return 0; |
| 257 } | 257 } |
| 258 ASSERT(successCallback->fileWriterBase()); | 258 ASSERT(successCallback->fileWriterBase()); |
| 259 ASSERT(static_cast<FileWriterSync*>(successCallback->fileWriterBase()) == fi
leWriter.get()); | 259 ASSERT(static_cast<FileWriterSync*>(successCallback->fileWriterBase()) == fi
leWriter.get()); |
| 260 return fileWriter; | 260 return fileWriter; |
| 261 } | 261 } |
| 262 | 262 |
| 263 } | 263 } |
| OLD | NEW |