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

Side by Side Diff: webkit/tools/test_shell/simple_file_system.cc

Issue 9016020: Cleanup FileSystemOperation for preparing for adding FSO-factory method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/tools/test_shell/simple_file_system.h" 5 #include "webkit/tools/test_shell/simple_file_system.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/memory/scoped_callback_factory.h" 8 #include "base/memory/scoped_callback_factory.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 type = fileapi::kFileSystemTypePersistent; 156 type = fileapi::kFileSystemTypePersistent;
157 else if (web_filesystem_type == WebFileSystem::TypeExternal) 157 else if (web_filesystem_type == WebFileSystem::TypeExternal)
158 type = fileapi::kFileSystemTypeExternal; 158 type = fileapi::kFileSystemTypeExternal;
159 else { 159 else {
160 // Unknown type filesystem is requested. 160 // Unknown type filesystem is requested.
161 callbacks->didFail(WebKit::WebFileErrorSecurity); 161 callbacks->didFail(WebKit::WebFileErrorSecurity);
162 return; 162 return;
163 } 163 }
164 164
165 GURL origin_url(frame->document().securityOrigin().toString()); 165 GURL origin_url(frame->document().securityOrigin().toString());
166 GetNewOperation(callbacks)->OpenFileSystem(origin_url, type, create); 166 file_system_context_->OpenFileSystem(
167 origin_url, type, create,
168 new SimpleFileSystemCallbackDispatcher(AsWeakPtr(), callbacks));
167 } 169 }
168 170
169 void SimpleFileSystem::move( 171 void SimpleFileSystem::move(
170 const WebURL& src_path, 172 const WebURL& src_path,
171 const WebURL& dest_path, WebFileSystemCallbacks* callbacks) { 173 const WebURL& dest_path, WebFileSystemCallbacks* callbacks) {
172 GetNewOperation(callbacks)->Move(GURL(src_path), GURL(dest_path)); 174 GetNewOperation(callbacks)->Move(GURL(src_path), GURL(dest_path));
173 } 175 }
174 176
175 void SimpleFileSystem::copy( 177 void SimpleFileSystem::copy(
176 const WebURL& src_path, const WebURL& dest_path, 178 const WebURL& src_path, const WebURL& dest_path,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 227
226 FileSystemOperation* SimpleFileSystem::GetNewOperation( 228 FileSystemOperation* SimpleFileSystem::GetNewOperation(
227 WebFileSystemCallbacks* callbacks) { 229 WebFileSystemCallbacks* callbacks) {
228 SimpleFileSystemCallbackDispatcher* dispatcher = 230 SimpleFileSystemCallbackDispatcher* dispatcher =
229 new SimpleFileSystemCallbackDispatcher(AsWeakPtr(), callbacks); 231 new SimpleFileSystemCallbackDispatcher(AsWeakPtr(), callbacks);
230 FileSystemOperation* operation = new FileSystemOperation( 232 FileSystemOperation* operation = new FileSystemOperation(
231 dispatcher, base::MessageLoopProxy::current(), 233 dispatcher, base::MessageLoopProxy::current(),
232 file_system_context_.get()); 234 file_system_context_.get());
233 return operation; 235 return operation;
234 } 236 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698