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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 EntrySync* EntrySync::create(EntryBase* entry) | 45 EntrySync* EntrySync::create(EntryBase* entry) |
46 { | 46 { |
47 if (entry->isFile()) | 47 if (entry->isFile()) |
48 return FileEntrySync::create(entry->m_fileSystem, entry->m_fullPath); | 48 return FileEntrySync::create(entry->m_fileSystem, entry->m_fullPath); |
49 return DirectoryEntrySync::create(entry->m_fileSystem, entry->m_fullPath); | 49 return DirectoryEntrySync::create(entry->m_fileSystem, entry->m_fullPath); |
50 } | 50 } |
51 | 51 |
52 Metadata* EntrySync::getMetadata(ExceptionState& exceptionState) | 52 Metadata* EntrySync::getMetadata(ExceptionState& exceptionState) |
53 { | 53 { |
54 MetadataSyncCallbackHelper* helper = MetadataSyncCallbackHelper::create(); | 54 MetadataSyncCallbackHelper* helper = MetadataSyncCallbackHelper::create(); |
55 m_fileSystem->getMetadata(this, helper->successCallback(), helper->errorCall
back(), DOMFileSystemBase::Synchronous); | 55 m_fileSystem->getMetadata(this, helper->getSuccessCallback(), helper->getErr
orCallback(), DOMFileSystemBase::Synchronous); |
56 return helper->getResult(exceptionState); | 56 return helper->getResult(exceptionState); |
57 } | 57 } |
58 | 58 |
59 EntrySync* EntrySync::moveTo(DirectoryEntrySync* parent, const String& name, Exc
eptionState& exceptionState) const | 59 EntrySync* EntrySync::moveTo(DirectoryEntrySync* parent, const String& name, Exc
eptionState& exceptionState) const |
60 { | 60 { |
61 EntrySyncCallbackHelper* helper = EntrySyncCallbackHelper::create(); | 61 EntrySyncCallbackHelper* helper = EntrySyncCallbackHelper::create(); |
62 m_fileSystem->move(this, parent, name, helper->successCallback(), helper->er
rorCallback(), DOMFileSystemBase::Synchronous); | 62 m_fileSystem->move(this, parent, name, helper->getSuccessCallback(), helper-
>getErrorCallback(), DOMFileSystemBase::Synchronous); |
63 return helper->getResult(exceptionState); | 63 return helper->getResult(exceptionState); |
64 } | 64 } |
65 | 65 |
66 EntrySync* EntrySync::copyTo(DirectoryEntrySync* parent, const String& name, Exc
eptionState& exceptionState) const | 66 EntrySync* EntrySync::copyTo(DirectoryEntrySync* parent, const String& name, Exc
eptionState& exceptionState) const |
67 { | 67 { |
68 EntrySyncCallbackHelper* helper = EntrySyncCallbackHelper::create(); | 68 EntrySyncCallbackHelper* helper = EntrySyncCallbackHelper::create(); |
69 m_fileSystem->copy(this, parent, name, helper->successCallback(), helper->er
rorCallback(), DOMFileSystemBase::Synchronous); | 69 m_fileSystem->copy(this, parent, name, helper->getSuccessCallback(), helper-
>getErrorCallback(), DOMFileSystemBase::Synchronous); |
70 return helper->getResult(exceptionState); | 70 return helper->getResult(exceptionState); |
71 } | 71 } |
72 | 72 |
73 void EntrySync::remove(ExceptionState& exceptionState) const | 73 void EntrySync::remove(ExceptionState& exceptionState) const |
74 { | 74 { |
75 VoidSyncCallbackHelper* helper = VoidSyncCallbackHelper::create(); | 75 VoidSyncCallbackHelper* helper = VoidSyncCallbackHelper::create(); |
76 m_fileSystem->remove(this, helper->successCallback(), helper->errorCallback(
), DOMFileSystemBase::Synchronous); | 76 m_fileSystem->remove(this, helper->getSuccessCallback(), helper->getErrorCal
lback(), DOMFileSystemBase::Synchronous); |
77 helper->getResult(exceptionState); | 77 helper->getResult(exceptionState); |
78 } | 78 } |
79 | 79 |
80 EntrySync* EntrySync::getParent() const | 80 EntrySync* EntrySync::getParent() const |
81 { | 81 { |
82 // Sync verion of getParent doesn't throw exceptions. | 82 // Sync verion of getParent doesn't throw exceptions. |
83 String parentPath = DOMFilePath::getDirectory(fullPath()); | 83 String parentPath = DOMFilePath::getDirectory(fullPath()); |
84 return DirectoryEntrySync::create(m_fileSystem, parentPath); | 84 return DirectoryEntrySync::create(m_fileSystem, parentPath); |
85 } | 85 } |
86 | 86 |
87 EntrySync::EntrySync(DOMFileSystemBase* fileSystem, const String& fullPath) | 87 EntrySync::EntrySync(DOMFileSystemBase* fileSystem, const String& fullPath) |
88 : EntryBase(fileSystem, fullPath) | 88 : EntryBase(fileSystem, fullPath) |
89 { | 89 { |
90 } | 90 } |
91 | 91 |
92 DEFINE_TRACE(EntrySync) | 92 DEFINE_TRACE(EntrySync) |
93 { | 93 { |
94 EntryBase::trace(visitor); | 94 EntryBase::trace(visitor); |
95 } | 95 } |
96 | 96 |
97 } // namespace blink | 97 } // namespace blink |
OLD | NEW |