| 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/child_thread.h" | 8 #include "chrome/common/child_thread.h" |
| 9 | 9 |
| 10 using WebKit::WebString; | 10 using WebKit::WebString; |
| 11 using WebKit::WebFileSystemCallbacks; | 11 using WebKit::WebFileSystemCallbacks; |
| 12 | 12 |
| 13 WebFileSystemImpl::WebFileSystemImpl() { | 13 WebFileSystemImpl::WebFileSystemImpl() { |
| 14 } | 14 } |
| 15 | 15 |
| 16 void WebFileSystemImpl::move(const WebString& src_path, | 16 void WebFileSystemImpl::move(const WebString& src_path, |
| 17 const WebString& dest_path, WebFileSystemCallbacks* callbacks) { | 17 const WebString& dest_path, WebFileSystemCallbacks* callbacks) { |
| 18 FileSystemDispatcher* dispatcher = | 18 FileSystemDispatcher* dispatcher = |
| 19 ChildThread::current()->file_system_dispatcher(); | 19 ChildThread::current()->file_system_dispatcher(); |
| 20 dispatcher->Move(src_path, dest_path, callbacks); | 20 dispatcher->Move(src_path, dest_path, callbacks); |
| 21 } | 21 } |
| 22 | 22 |
| 23 void WebFileSystemImpl::copy(const WebKit::WebString& src_path, | 23 void WebFileSystemImpl::copy(const WebKit::WebString& src_path, |
| 24 const WebKit::WebString& dest_path, | 24 const WebKit::WebString& dest_path, |
| 25 WebKit::WebFileSystemCallbacks* callbacks) { | 25 WebKit::WebFileSystemCallbacks* callbacks) { |
| 26 FileSystemDispatcher* dispatcher = | 26 // TODO(kinuko): not implemented yet. |
| 27 ChildThread::current()->file_system_dispatcher(); | |
| 28 dispatcher->Copy(src_path, dest_path, callbacks); | |
| 29 } | 27 } |
| 30 | 28 |
| 31 void WebFileSystemImpl::remove(const WebString& path, | 29 void WebFileSystemImpl::remove(const WebString& path, |
| 32 WebFileSystemCallbacks* callbacks) { | 30 WebFileSystemCallbacks* callbacks) { |
| 33 FileSystemDispatcher* dispatcher = | 31 // TODO(kinuko): not implemented yet. |
| 34 ChildThread::current()->file_system_dispatcher(); | |
| 35 dispatcher->Remove(path, callbacks); | |
| 36 } | 32 } |
| 37 | 33 |
| 38 void WebFileSystemImpl::readMetadata(const WebString& path, | 34 void WebFileSystemImpl::readMetadata(const WebString& path, |
| 39 WebFileSystemCallbacks* callbacks) { | 35 WebFileSystemCallbacks* callbacks) { |
| 40 FileSystemDispatcher* dispatcher = | 36 // TODO(kinuko): not implemented yet. |
| 41 ChildThread::current()->file_system_dispatcher(); | |
| 42 dispatcher->ReadMetadata(path, callbacks); | |
| 43 } | 37 } |
| 44 | 38 |
| 45 void WebFileSystemImpl::createFile(const WebString& path, | 39 void WebFileSystemImpl::createFile(const WebString& path, |
| 46 bool exclusive, WebFileSystemCallbacks* callbacks) { | 40 bool exclusive, WebFileSystemCallbacks* callbacks) { |
| 47 FileSystemDispatcher* dispatcher = | 41 // TODO(kinuko): not implemented yet. |
| 48 ChildThread::current()->file_system_dispatcher(); | |
| 49 dispatcher->Create(path, exclusive, false, callbacks); | |
| 50 } | 42 } |
| 51 | 43 |
| 52 void WebFileSystemImpl::createDirectory(const WebString& path, | 44 void WebFileSystemImpl::createDirectory(const WebString& path, |
| 53 bool exclusive, WebFileSystemCallbacks* callbacks) { | 45 bool exclusive, WebFileSystemCallbacks* callbacks) { |
| 54 FileSystemDispatcher* dispatcher = | 46 // TODO(kinuko): not implemented yet. |
| 55 ChildThread::current()->file_system_dispatcher(); | |
| 56 dispatcher->Create(path, exclusive, true, callbacks); | |
| 57 } | 47 } |
| 58 | 48 |
| 59 void WebFileSystemImpl::fileExists(const WebString& path, | 49 void WebFileSystemImpl::fileExists(const WebString& path, |
| 60 WebFileSystemCallbacks* callbacks) { | 50 WebFileSystemCallbacks* callbacks) { |
| 61 FileSystemDispatcher* dispatcher = | 51 // TODO(kinuko): not implemented yet. |
| 62 ChildThread::current()->file_system_dispatcher(); | |
| 63 dispatcher->Exists(path, false, callbacks); | |
| 64 } | 52 } |
| 65 | 53 |
| 66 void WebFileSystemImpl::directoryExists(const WebString& path, | 54 void WebFileSystemImpl::directoryExists(const WebString& path, |
| 67 WebFileSystemCallbacks* callbacks) { | 55 WebFileSystemCallbacks* callbacks) { |
| 68 FileSystemDispatcher* dispatcher = | 56 // TODO(kinuko): not implemented yet. |
| 69 ChildThread::current()->file_system_dispatcher(); | |
| 70 dispatcher->Exists(path, true, callbacks); | |
| 71 } | 57 } |
| 72 | 58 |
| 73 void WebFileSystemImpl::readDirectory(const WebString& path, | 59 void WebFileSystemImpl::readDirectory(const WebString& path, |
| 74 WebFileSystemCallbacks* callbacks) { | 60 WebFileSystemCallbacks* callbacks) { |
| 75 FileSystemDispatcher* dispatcher = | 61 // TODO(kinuko): not implemented yet. |
| 76 ChildThread::current()->file_system_dispatcher(); | |
| 77 dispatcher->ReadDirectory(path, callbacks); | |
| 78 } | 62 } |
| OLD | NEW |