| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 : EntrySync(fileSystem, fullPath) | 44 : EntrySync(fileSystem, fullPath) |
| 45 { | 45 { |
| 46 ScriptWrappable::init(this); | 46 ScriptWrappable::init(this); |
| 47 } | 47 } |
| 48 | 48 |
| 49 PassRefPtr<DirectoryReaderSync> DirectoryEntrySync::createReader() | 49 PassRefPtr<DirectoryReaderSync> DirectoryEntrySync::createReader() |
| 50 { | 50 { |
| 51 return DirectoryReaderSync::create(m_fileSystem, m_fullPath); | 51 return DirectoryReaderSync::create(m_fileSystem, m_fullPath); |
| 52 } | 52 } |
| 53 | 53 |
| 54 PassRefPtr<FileEntrySync> DirectoryEntrySync::getFile(const String& path, const
Dictionary& options, ExceptionState& es) | 54 PassRefPtr<FileEntrySync> DirectoryEntrySync::getFile(const String& path, const
Dictionary& options, ExceptionState& exceptionState) |
| 55 { | 55 { |
| 56 FileSystemFlags flags(options); | 56 FileSystemFlags flags(options); |
| 57 EntrySyncCallbackHelper helper; | 57 EntrySyncCallbackHelper helper; |
| 58 if (!m_fileSystem->getFile(this, path, flags, helper.successCallback(), help
er.errorCallback(), DOMFileSystemBase::Synchronous)) { | 58 if (!m_fileSystem->getFile(this, path, flags, helper.successCallback(), help
er.errorCallback(), DOMFileSystemBase::Synchronous)) { |
| 59 es.throwDOMException(InvalidModificationError, ExceptionMessages::failed
ToExecute("getFile", "DirectoryEntrySync")); | 59 exceptionState.throwDOMException(InvalidModificationError, ExceptionMess
ages::failedToExecute("getFile", "DirectoryEntrySync")); |
| 60 return 0; | 60 return 0; |
| 61 } | 61 } |
| 62 return static_pointer_cast<FileEntrySync>(helper.getResult(es)); | 62 return static_pointer_cast<FileEntrySync>(helper.getResult(exceptionState)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 PassRefPtr<DirectoryEntrySync> DirectoryEntrySync::getDirectory(const String& pa
th, const Dictionary& options, ExceptionState& es) | 65 PassRefPtr<DirectoryEntrySync> DirectoryEntrySync::getDirectory(const String& pa
th, const Dictionary& options, ExceptionState& exceptionState) |
| 66 { | 66 { |
| 67 FileSystemFlags flags(options); | 67 FileSystemFlags flags(options); |
| 68 EntrySyncCallbackHelper helper; | 68 EntrySyncCallbackHelper helper; |
| 69 if (!m_fileSystem->getDirectory(this, path, flags, helper.successCallback(),
helper.errorCallback(), DOMFileSystemBase::Synchronous)) { | 69 if (!m_fileSystem->getDirectory(this, path, flags, helper.successCallback(),
helper.errorCallback(), DOMFileSystemBase::Synchronous)) { |
| 70 es.throwDOMException(InvalidModificationError, ExceptionMessages::failed
ToExecute("getDirectory", "DirectoryEntrySync")); | 70 exceptionState.throwDOMException(InvalidModificationError, ExceptionMess
ages::failedToExecute("getDirectory", "DirectoryEntrySync")); |
| 71 return 0; | 71 return 0; |
| 72 } | 72 } |
| 73 return static_pointer_cast<DirectoryEntrySync>(helper.getResult(es)); | 73 return static_pointer_cast<DirectoryEntrySync>(helper.getResult(exceptionSta
te)); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void DirectoryEntrySync::removeRecursively(ExceptionState& es) | 76 void DirectoryEntrySync::removeRecursively(ExceptionState& exceptionState) |
| 77 { | 77 { |
| 78 VoidSyncCallbackHelper helper; | 78 VoidSyncCallbackHelper helper; |
| 79 if (!m_fileSystem->removeRecursively(this, helper.successCallback(), helper.
errorCallback(), DOMFileSystemBase::Synchronous)) { | 79 if (!m_fileSystem->removeRecursively(this, helper.successCallback(), helper.
errorCallback(), DOMFileSystemBase::Synchronous)) { |
| 80 es.throwDOMException(InvalidModificationError, ExceptionMessages::failed
ToExecute("removeRecursively", "DirectoryEntrySync")); | 80 exceptionState.throwDOMException(InvalidModificationError, ExceptionMess
ages::failedToExecute("removeRecursively", "DirectoryEntrySync")); |
| 81 return; | 81 return; |
| 82 } | 82 } |
| 83 helper.getResult(es); | 83 helper.getResult(exceptionState); |
| 84 } | 84 } |
| 85 | 85 |
| 86 } | 86 } |
| OLD | NEW |