OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/common/file_system/webfilesystem_impl.h" | 5 #include "chrome/common/file_system/webfilesystem_impl.h" |
6 | 6 |
7 #include "chrome/common/file_system/file_system_dispatcher.h" | 7 #include "chrome/common/file_system/file_system_dispatcher.h" |
8 #include "chrome/common/file_system/webfilesystem_callback_dispatcher.h" | 8 #include "chrome/common/file_system/webfilesystem_callback_dispatcher.h" |
9 #include "chrome/common/file_system/webfilewriter_impl.h" | 9 #include "chrome/common/file_system/webfilewriter_impl.h" |
10 #include "chrome/common/child_thread.h" | 10 #include "chrome/common/child_thread.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 dispatcher->Copy(webkit_glue::WebStringToFilePath(src_path), | 40 dispatcher->Copy(webkit_glue::WebStringToFilePath(src_path), |
41 webkit_glue::WebStringToFilePath(dest_path), | 41 webkit_glue::WebStringToFilePath(dest_path), |
42 new WebFileSystemCallbackDispatcher(callbacks)); | 42 new WebFileSystemCallbackDispatcher(callbacks)); |
43 } | 43 } |
44 | 44 |
45 void WebFileSystemImpl::remove(const WebString& path, | 45 void WebFileSystemImpl::remove(const WebString& path, |
46 WebFileSystemCallbacks* callbacks) { | 46 WebFileSystemCallbacks* callbacks) { |
47 FileSystemDispatcher* dispatcher = | 47 FileSystemDispatcher* dispatcher = |
48 ChildThread::current()->file_system_dispatcher(); | 48 ChildThread::current()->file_system_dispatcher(); |
49 dispatcher->Remove(webkit_glue::WebStringToFilePath(path), | 49 dispatcher->Remove(webkit_glue::WebStringToFilePath(path), |
| 50 false /* recursive */, |
50 new WebFileSystemCallbackDispatcher(callbacks)); | 51 new WebFileSystemCallbackDispatcher(callbacks)); |
51 } | 52 } |
52 | 53 |
| 54 void WebFileSystemImpl::removeRecursively(const WebString& path, |
| 55 WebFileSystemCallbacks* callbacks) { |
| 56 FileSystemDispatcher* dispatcher = |
| 57 ChildThread::current()->file_system_dispatcher(); |
| 58 dispatcher->Remove(webkit_glue::WebStringToFilePath(path), |
| 59 true /* recursive */, |
| 60 new WebFileSystemCallbackDispatcher(callbacks)); |
| 61 } |
| 62 |
53 void WebFileSystemImpl::readMetadata(const WebString& path, | 63 void WebFileSystemImpl::readMetadata(const WebString& path, |
54 WebFileSystemCallbacks* callbacks) { | 64 WebFileSystemCallbacks* callbacks) { |
55 FileSystemDispatcher* dispatcher = | 65 FileSystemDispatcher* dispatcher = |
56 ChildThread::current()->file_system_dispatcher(); | 66 ChildThread::current()->file_system_dispatcher(); |
57 dispatcher->ReadMetadata(webkit_glue::WebStringToFilePath(path), | 67 dispatcher->ReadMetadata(webkit_glue::WebStringToFilePath(path), |
58 new WebFileSystemCallbackDispatcher(callbacks)); | 68 new WebFileSystemCallbackDispatcher(callbacks)); |
59 } | 69 } |
60 | 70 |
61 void WebFileSystemImpl::createFile(const WebString& path, | 71 void WebFileSystemImpl::createFile(const WebString& path, |
62 bool exclusive, | 72 bool exclusive, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 FileSystemDispatcher* dispatcher = | 107 FileSystemDispatcher* dispatcher = |
98 ChildThread::current()->file_system_dispatcher(); | 108 ChildThread::current()->file_system_dispatcher(); |
99 dispatcher->ReadDirectory(webkit_glue::WebStringToFilePath(path), | 109 dispatcher->ReadDirectory(webkit_glue::WebStringToFilePath(path), |
100 new WebFileSystemCallbackDispatcher(callbacks)); | 110 new WebFileSystemCallbackDispatcher(callbacks)); |
101 } | 111 } |
102 | 112 |
103 WebKit::WebFileWriter* WebFileSystemImpl::createFileWriter( | 113 WebKit::WebFileWriter* WebFileSystemImpl::createFileWriter( |
104 const WebString& path, WebKit::WebFileWriterClient* client) { | 114 const WebString& path, WebKit::WebFileWriterClient* client) { |
105 return new WebFileWriterImpl(path, client); | 115 return new WebFileWriterImpl(path, client); |
106 } | 116 } |
107 | |
OLD | NEW |