diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-16 04:20:06 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-16 04:20:06 +0000 |
commit | 3eb080d7d3350e2196eb70f2b0c662a3e493be2f (patch) | |
tree | fadf3dfb6718571885acfe6e501fc0c47dbf1386 /webkit/tools | |
parent | 1db76f2fa3aaf7b921a7514c1767bf8aa1f06410 (diff) | |
download | chromium_src-3eb080d7d3350e2196eb70f2b0c662a3e493be2f.zip chromium_src-3eb080d7d3350e2196eb70f2b0c662a3e493be2f.tar.gz chromium_src-3eb080d7d3350e2196eb70f2b0c662a3e493be2f.tar.bz2 |
Add CreateFileSystemOperation() method to FileSystemContext
BUG=none
TEST=no functional changes
Review URL: http://codereview.chromium.org/8999017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117830 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r-- | webkit/tools/test_shell/simple_file_system.cc | 35 | ||||
-rw-r--r-- | webkit/tools/test_shell/simple_file_system.h | 8 | ||||
-rw-r--r-- | webkit/tools/test_shell/simple_file_writer.cc | 16 |
3 files changed, 29 insertions, 30 deletions
diff --git a/webkit/tools/test_shell/simple_file_system.cc b/webkit/tools/test_shell/simple_file_system.cc index 8eb34fb..4dfb1ac 100644 --- a/webkit/tools/test_shell/simple_file_system.cc +++ b/webkit/tools/test_shell/simple_file_system.cc @@ -20,7 +20,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" #include "webkit/fileapi/file_system_callback_dispatcher.h" #include "webkit/fileapi/file_system_context.h" -#include "webkit/fileapi/file_system_operation.h" +#include "webkit/fileapi/file_system_operation_interface.h" #include "webkit/fileapi/file_system_types.h" #include "webkit/fileapi/mock_file_system_options.h" #include "webkit/glue/webkit_glue.h" @@ -42,7 +42,7 @@ using WebKit::WebVector; using fileapi::FileSystemCallbackDispatcher; using fileapi::FileSystemContext; -using fileapi::FileSystemOperation; +using fileapi::FileSystemOperationInterface; namespace { @@ -179,53 +179,53 @@ void SimpleFileSystem::OpenFileSystem( void SimpleFileSystem::move( const WebURL& src_path, const WebURL& dest_path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(callbacks)->Move(GURL(src_path), GURL(dest_path)); + GetNewOperation(src_path, callbacks)->Move(GURL(src_path), GURL(dest_path)); } void SimpleFileSystem::copy( const WebURL& src_path, const WebURL& dest_path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(callbacks)->Copy(GURL(src_path), GURL(dest_path)); + GetNewOperation(src_path, callbacks)->Copy(GURL(src_path), GURL(dest_path)); } void SimpleFileSystem::remove( const WebURL& path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(callbacks)->Remove(path, false /* recursive */); + GetNewOperation(path, callbacks)->Remove(path, false /* recursive */); } void SimpleFileSystem::removeRecursively( const WebURL& path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(callbacks)->Remove(path, true /* recursive */); + GetNewOperation(path, callbacks)->Remove(path, true /* recursive */); } void SimpleFileSystem::readMetadata( const WebURL& path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(callbacks)->GetMetadata(path); + GetNewOperation(path, callbacks)->GetMetadata(path); } void SimpleFileSystem::createFile( const WebURL& path, bool exclusive, WebFileSystemCallbacks* callbacks) { - GetNewOperation(callbacks)->CreateFile(path, exclusive); + GetNewOperation(path, callbacks)->CreateFile(path, exclusive); } void SimpleFileSystem::createDirectory( const WebURL& path, bool exclusive, WebFileSystemCallbacks* callbacks) { - GetNewOperation(callbacks)->CreateDirectory(path, exclusive, false); + GetNewOperation(path, callbacks)->CreateDirectory(path, exclusive, false); } void SimpleFileSystem::fileExists( const WebURL& path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(callbacks)->FileExists(path); + GetNewOperation(path, callbacks)->FileExists(path); } void SimpleFileSystem::directoryExists( const WebURL& path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(callbacks)->DirectoryExists(path); + GetNewOperation(path, callbacks)->DirectoryExists(path); } void SimpleFileSystem::readDirectory( const WebURL& path, WebFileSystemCallbacks* callbacks) { - GetNewOperation(callbacks)->ReadDirectory(path); + GetNewOperation(path, callbacks)->ReadDirectory(path); } WebFileWriter* SimpleFileSystem::createFileWriter( @@ -233,11 +233,10 @@ WebFileWriter* SimpleFileSystem::createFileWriter( return new SimpleFileWriter(path, client, file_system_context_.get()); } -FileSystemOperation* SimpleFileSystem::GetNewOperation( - WebFileSystemCallbacks* callbacks) { - FileSystemOperation* operation = new FileSystemOperation( +FileSystemOperationInterface* SimpleFileSystem::GetNewOperation( + const WebURL& url, WebFileSystemCallbacks* callbacks) { + return file_system_context_->CreateFileSystemOperation( + GURL(url), SimpleFileSystemCallbackDispatcher::Create(AsWeakPtr(), callbacks), - base::MessageLoopProxy::current(), - file_system_context_.get()); - return operation; + base::MessageLoopProxy::current()); } diff --git a/webkit/tools/test_shell/simple_file_system.h b/webkit/tools/test_shell/simple_file_system.h index 90693ff..82c2e01 100644 --- a/webkit/tools/test_shell/simple_file_system.h +++ b/webkit/tools/test_shell/simple_file_system.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -21,7 +21,7 @@ class WebURL; namespace fileapi { class FileSystemContext; -class FileSystemOperation; +class FileSystemOperationInterface; } class SimpleFileSystem @@ -81,8 +81,8 @@ class SimpleFileSystem private: // Helpers. - fileapi::FileSystemOperation* GetNewOperation( - WebKit::WebFileSystemCallbacks* callbacks); + fileapi::FileSystemOperationInterface* GetNewOperation( + const WebKit::WebURL& path, WebKit::WebFileSystemCallbacks* callbacks); // A temporary directory for FileSystem API. ScopedTempDir file_system_dir_; diff --git a/webkit/tools/test_shell/simple_file_writer.cc b/webkit/tools/test_shell/simple_file_writer.cc index 169106b..cdd36b1 100644 --- a/webkit/tools/test_shell/simple_file_writer.cc +++ b/webkit/tools/test_shell/simple_file_writer.cc @@ -10,13 +10,13 @@ #include "net/url_request/url_request_context.h" #include "webkit/fileapi/file_system_callback_dispatcher.h" #include "webkit/fileapi/file_system_context.h" -#include "webkit/fileapi/file_system_operation.h" +#include "webkit/fileapi/file_system_operation_interface.h" #include "webkit/glue/webkit_glue.h" #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" using fileapi::FileSystemCallbackDispatcher; using fileapi::FileSystemContext; -using fileapi::FileSystemOperation; +using fileapi::FileSystemOperationInterface; using fileapi::WebFileWriterBase; using WebKit::WebFileWriterClient; using WebKit::WebString; @@ -52,7 +52,7 @@ class SimpleFileWriter::IOThreadProxy return; } DCHECK(!operation_); - operation_ = GetNewOperation(); + operation_ = GetNewOperation(path); operation_->Truncate(path, offset); } @@ -65,7 +65,7 @@ class SimpleFileWriter::IOThreadProxy } DCHECK(request_context_); DCHECK(!operation_); - operation_ = GetNewOperation(); + operation_ = GetNewOperation(path); operation_->Write(request_context_, path, blob_url, offset); } @@ -134,10 +134,10 @@ class SimpleFileWriter::IOThreadProxy scoped_refptr<IOThreadProxy> proxy_; }; - FileSystemOperation* GetNewOperation() { + FileSystemOperationInterface* GetNewOperation(const GURL& path) { // The FileSystemOperation takes ownership of the CallbackDispatcher. - return new FileSystemOperation(CallbackDispatcher::Create(this), - io_thread_, file_system_context_.get()); + return file_system_context_->CreateFileSystemOperation( + path, CallbackDispatcher::Create(this), io_thread_); } void DidSucceed() { @@ -185,7 +185,7 @@ class SimpleFileWriter::IOThreadProxy base::WeakPtr<SimpleFileWriter> simple_writer_; // Only used on the io thread. - FileSystemOperation* operation_; + FileSystemOperationInterface* operation_; scoped_refptr<FileSystemContext> file_system_context_; }; |