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

Side by Side Diff: chrome/common/file_system/webfilesystem_impl.cc

Issue 3208007: Add final part of IPC plumbing for FileSystem API (Closed)
Patch Set: fixing Created 10 years, 3 months 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 // 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 // TODO(kinuko): not implemented yet. 26 FileSystemDispatcher* dispatcher =
27 ChildThread::current()->file_system_dispatcher();
28 dispatcher->Copy(src_path, dest_path, callbacks);
27 } 29 }
28 30
29 void WebFileSystemImpl::remove(const WebString& path, 31 void WebFileSystemImpl::remove(const WebString& path,
30 WebFileSystemCallbacks* callbacks) { 32 WebFileSystemCallbacks* callbacks) {
31 // TODO(kinuko): not implemented yet. 33 FileSystemDispatcher* dispatcher =
34 ChildThread::current()->file_system_dispatcher();
35 dispatcher->Remove(path, callbacks);
32 } 36 }
33 37
34 void WebFileSystemImpl::readMetadata(const WebString& path, 38 void WebFileSystemImpl::readMetadata(const WebString& path,
35 WebFileSystemCallbacks* callbacks) { 39 WebFileSystemCallbacks* callbacks) {
36 // TODO(kinuko): not implemented yet. 40 FileSystemDispatcher* dispatcher =
41 ChildThread::current()->file_system_dispatcher();
42 dispatcher->ReadMetadata(path, callbacks);
37 } 43 }
38 44
39 void WebFileSystemImpl::createFile(const WebString& path, 45 void WebFileSystemImpl::createFile(const WebString& path,
40 bool exclusive, WebFileSystemCallbacks* callbacks) { 46 bool exclusive, WebFileSystemCallbacks* callbacks) {
41 // TODO(kinuko): not implemented yet. 47 FileSystemDispatcher* dispatcher =
48 ChildThread::current()->file_system_dispatcher();
49 dispatcher->Create(path, exclusive, false, callbacks);
42 } 50 }
43 51
44 void WebFileSystemImpl::createDirectory(const WebString& path, 52 void WebFileSystemImpl::createDirectory(const WebString& path,
45 bool exclusive, WebFileSystemCallbacks* callbacks) { 53 bool exclusive, WebFileSystemCallbacks* callbacks) {
46 // TODO(kinuko): not implemented yet. 54 FileSystemDispatcher* dispatcher =
55 ChildThread::current()->file_system_dispatcher();
56 dispatcher->Create(path, exclusive, true, callbacks);
47 } 57 }
48 58
49 void WebFileSystemImpl::fileExists(const WebString& path, 59 void WebFileSystemImpl::fileExists(const WebString& path,
50 WebFileSystemCallbacks* callbacks) { 60 WebFileSystemCallbacks* callbacks) {
51 // TODO(kinuko): not implemented yet. 61 FileSystemDispatcher* dispatcher =
62 ChildThread::current()->file_system_dispatcher();
63 dispatcher->Exists(path, false, callbacks);
52 } 64 }
53 65
54 void WebFileSystemImpl::directoryExists(const WebString& path, 66 void WebFileSystemImpl::directoryExists(const WebString& path,
55 WebFileSystemCallbacks* callbacks) { 67 WebFileSystemCallbacks* callbacks) {
56 // TODO(kinuko): not implemented yet. 68 FileSystemDispatcher* dispatcher =
69 ChildThread::current()->file_system_dispatcher();
70 dispatcher->Exists(path, true, callbacks);
57 } 71 }
58 72
59 void WebFileSystemImpl::readDirectory(const WebString& path, 73 void WebFileSystemImpl::readDirectory(const WebString& path,
60 WebFileSystemCallbacks* callbacks) { 74 WebFileSystemCallbacks* callbacks) {
61 // TODO(kinuko): not implemented yet. 75 FileSystemDispatcher* dispatcher =
76 ChildThread::current()->file_system_dispatcher();
77 dispatcher->ReadDirectory(path, callbacks);
62 } 78 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698