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