OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | |
3 * | |
4 * Redistribution and use in source and binary forms, with or without | |
5 * modification, are permitted provided that the following conditions are | |
6 * met: | |
7 * | |
8 * * Redistributions of source code must retain the above copyright | |
9 * notice, this list of conditions and the following disclaimer. | |
10 * * Redistributions in binary form must reproduce the above | |
11 * copyright notice, this list of conditions and the following disclaimer | |
12 * in the documentation and/or other materials provided with the | |
13 * distribution. | |
14 * * Neither the name of Google Inc. nor the names of its | |
15 * contributors may be used to endorse or promote products derived from | |
16 * this software without specific prior written permission. | |
17 * | |
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
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. | |
29 */ | |
30 #include "config.h" | |
31 #include "AsyncFileSystemChromium.h" | |
32 | |
33 #include "WebFileSystemCallbacksImpl.h" | |
34 #include "core/platform/AsyncFileSystemCallbacks.h" | |
35 #include "core/platform/FileMetadata.h" | |
36 #include "public/platform/Platform.h" | |
37 #include "public/platform/WebFileInfo.h" | |
38 #include "public/platform/WebFileSystem.h" | |
39 #include "public/platform/WebFileWriter.h" | |
40 #include "public/platform/WebFileWriterClient.h" | |
41 #include "wtf/text/CString.h" | |
42 #include "wtf/text/StringBuilder.h" | |
43 | |
44 namespace WebCore { | |
45 | |
46 PassOwnPtr<AsyncFileSystem> AsyncFileSystem::create() | |
47 { | |
48 return AsyncFileSystemChromium::create(); | |
49 } | |
50 | |
51 AsyncFileSystemChromium::AsyncFileSystemChromium() | |
52 { | |
53 } | |
54 | |
55 AsyncFileSystemChromium::~AsyncFileSystemChromium() | |
56 { | |
57 } | |
58 | |
59 void AsyncFileSystemChromium::move(const KURL& sourcePath, const KURL& destinati
onPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) | |
60 { | |
61 webFileSystem()->move(sourcePath, destinationPath, new WebKit::WebFileSystem
CallbacksImpl(callbacks)); | |
62 } | |
63 | |
64 void AsyncFileSystemChromium::copy(const KURL& sourcePath, const KURL& destinati
onPath, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) | |
65 { | |
66 webFileSystem()->copy(sourcePath, destinationPath, new WebKit::WebFileSystem
CallbacksImpl(callbacks)); | |
67 } | |
68 | |
69 void AsyncFileSystemChromium::remove(const KURL& path, PassOwnPtr<AsyncFileSyste
mCallbacks> callbacks) | |
70 { | |
71 webFileSystem()->remove(path, new WebKit::WebFileSystemCallbacksImpl(callbac
ks)); | |
72 } | |
73 | |
74 void AsyncFileSystemChromium::removeRecursively(const KURL& path, PassOwnPtr<Asy
ncFileSystemCallbacks> callbacks) | |
75 { | |
76 webFileSystem()->removeRecursively(path, new WebKit::WebFileSystemCallbacksI
mpl(callbacks)); | |
77 } | |
78 | |
79 void AsyncFileSystemChromium::readMetadata(const KURL& path, PassOwnPtr<AsyncFil
eSystemCallbacks> callbacks) | |
80 { | |
81 webFileSystem()->readMetadata(path, new WebKit::WebFileSystemCallbacksImpl(c
allbacks)); | |
82 } | |
83 | |
84 void AsyncFileSystemChromium::createFile(const KURL& path, bool exclusive, PassO
wnPtr<AsyncFileSystemCallbacks> callbacks) | |
85 { | |
86 webFileSystem()->createFile(path, exclusive, new WebKit::WebFileSystemCallba
cksImpl(callbacks)); | |
87 } | |
88 | |
89 void AsyncFileSystemChromium::createDirectory(const KURL& path, bool exclusive,
PassOwnPtr<AsyncFileSystemCallbacks> callbacks) | |
90 { | |
91 webFileSystem()->createDirectory(path, exclusive, new WebKit::WebFileSystemC
allbacksImpl(callbacks)); | |
92 } | |
93 | |
94 void AsyncFileSystemChromium::fileExists(const KURL& path, PassOwnPtr<AsyncFileS
ystemCallbacks> callbacks) | |
95 { | |
96 webFileSystem()->fileExists(path, new WebKit::WebFileSystemCallbacksImpl(cal
lbacks)); | |
97 } | |
98 | |
99 void AsyncFileSystemChromium::directoryExists(const KURL& path, PassOwnPtr<Async
FileSystemCallbacks> callbacks) | |
100 { | |
101 webFileSystem()->directoryExists(path, new WebKit::WebFileSystemCallbacksImp
l(callbacks)); | |
102 } | |
103 | |
104 void AsyncFileSystemChromium::readDirectory(const KURL& path, PassOwnPtr<AsyncFi
leSystemCallbacks> callbacks) | |
105 { | |
106 webFileSystem()->readDirectory(path, new WebKit::WebFileSystemCallbacksImpl(
callbacks)); | |
107 } | |
108 | |
109 void AsyncFileSystemChromium::createWriter(WebKit::WebFileWriterClient* client,
const KURL& path, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) | |
110 { | |
111 webFileSystem()->createFileWriter(path, client, new WebKit::WebFileSystemCal
lbacksImpl(callbacks)); | |
112 } | |
113 | |
114 void AsyncFileSystemChromium::createSnapshotFileAndReadMetadata(const KURL& path
, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) | |
115 { | |
116 webFileSystem()->createSnapshotFileAndReadMetadata(path, new WebKit::WebFile
SystemCallbacksImpl(callbacks)); | |
117 } | |
118 | |
119 WebKit::WebFileSystem* AsyncFileSystemChromium::webFileSystem() | |
120 { | |
121 return WebKit::Platform::current()->fileSystem(); | |
122 } | |
123 | |
124 } // namespace WebCore | |
OLD | NEW |