Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/Source/modules/filesystem/FileSystemDirectoryEntrySync.cpp

Issue 2297043002: Web expose FileSystemFileEntry, FileSystemDirectoryEntry and friends (Closed)
Patch Set: Rebased Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "modules/filesystem/DirectoryEntrySync.h" 31 #include "modules/filesystem/FileSystemDirectoryEntrySync.h"
32 32
33 #include "bindings/core/v8/ExceptionMessages.h" 33 #include "bindings/core/v8/ExceptionMessages.h"
34 #include "bindings/core/v8/ExceptionState.h" 34 #include "bindings/core/v8/ExceptionState.h"
35 #include "modules/filesystem/DirectoryReaderSync.h" 35 #include "modules/filesystem/FileSystemDirectoryReaderSync.h"
36 #include "modules/filesystem/FileEntrySync.h" 36 #include "modules/filesystem/FileSystemFileEntrySync.h"
37 #include "modules/filesystem/FileSystemFlags.h" 37 #include "modules/filesystem/FileSystemFlags.h"
38 #include "modules/filesystem/SyncCallbackHelper.h" 38 #include "modules/filesystem/SyncCallbackHelper.h"
39 39
40 namespace blink { 40 namespace blink {
41 41
42 DirectoryEntrySync::DirectoryEntrySync(DOMFileSystemBase* fileSystem, 42 FileSystemDirectoryEntrySync::FileSystemDirectoryEntrySync(
43 const String& fullPath) 43 FileSystemBase* fileSystem,
44 : EntrySync(fileSystem, fullPath) {} 44 const String& fullPath)
45 : FileSystemEntrySync(fileSystem, fullPath) {}
45 46
46 DirectoryReaderSync* DirectoryEntrySync::createReader() { 47 FileSystemDirectoryReaderSync* FileSystemDirectoryEntrySync::createReader() {
47 return DirectoryReaderSync::create(m_fileSystem, m_fullPath); 48 return FileSystemDirectoryReaderSync::create(m_fileSystem, m_fullPath);
48 } 49 }
49 50
50 FileEntrySync* DirectoryEntrySync::getFile(const String& path, 51 FileSystemFileEntrySync* FileSystemDirectoryEntrySync::getFile(
51 const FileSystemFlags& options, 52 const String& path,
52 ExceptionState& exceptionState) { 53 const FileSystemFlags& options,
54 ExceptionState& exceptionState) {
53 EntrySyncCallbackHelper* helper = EntrySyncCallbackHelper::create(); 55 EntrySyncCallbackHelper* helper = EntrySyncCallbackHelper::create();
54 m_fileSystem->getFile(this, path, options, helper->getSuccessCallback(), 56 m_fileSystem->getFile(this, path, options, helper->getSuccessCallback(),
55 helper->getErrorCallback(), 57 helper->getErrorCallback(),
56 DOMFileSystemBase::Synchronous); 58 FileSystemBase::Synchronous);
57 return static_cast<FileEntrySync*>(helper->getResult(exceptionState)); 59 return static_cast<FileSystemFileEntrySync*>(
60 helper->getResult(exceptionState));
58 } 61 }
59 62
60 DirectoryEntrySync* DirectoryEntrySync::getDirectory( 63 FileSystemDirectoryEntrySync* FileSystemDirectoryEntrySync::getDirectory(
61 const String& path, 64 const String& path,
62 const FileSystemFlags& options, 65 const FileSystemFlags& options,
63 ExceptionState& exceptionState) { 66 ExceptionState& exceptionState) {
64 EntrySyncCallbackHelper* helper = EntrySyncCallbackHelper::create(); 67 EntrySyncCallbackHelper* helper = EntrySyncCallbackHelper::create();
65 m_fileSystem->getDirectory(this, path, options, helper->getSuccessCallback(), 68 m_fileSystem->getDirectory(this, path, options, helper->getSuccessCallback(),
66 helper->getErrorCallback(), 69 helper->getErrorCallback(),
67 DOMFileSystemBase::Synchronous); 70 FileSystemBase::Synchronous);
68 return static_cast<DirectoryEntrySync*>(helper->getResult(exceptionState)); 71 return static_cast<FileSystemDirectoryEntrySync*>(
72 helper->getResult(exceptionState));
69 } 73 }
70 74
71 void DirectoryEntrySync::removeRecursively(ExceptionState& exceptionState) { 75 void FileSystemDirectoryEntrySync::removeRecursively(
76 ExceptionState& exceptionState) {
72 VoidSyncCallbackHelper* helper = VoidSyncCallbackHelper::create(); 77 VoidSyncCallbackHelper* helper = VoidSyncCallbackHelper::create();
73 m_fileSystem->removeRecursively(this, helper->getSuccessCallback(), 78 m_fileSystem->removeRecursively(this, helper->getSuccessCallback(),
74 helper->getErrorCallback(), 79 helper->getErrorCallback(),
75 DOMFileSystemBase::Synchronous); 80 FileSystemBase::Synchronous);
76 helper->getResult(exceptionState); 81 helper->getResult(exceptionState);
77 } 82 }
78 83
79 DEFINE_TRACE(DirectoryEntrySync) { 84 DEFINE_TRACE(FileSystemDirectoryEntrySync) {
80 EntrySync::trace(visitor); 85 FileSystemEntrySync::trace(visitor);
81 } 86 }
82 87
83 } // namespace blink 88 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698