diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-26 11:53:50 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-26 11:53:50 +0000 |
commit | 08f8feb39b2c8801dd39a1531fb5958644162e6d (patch) | |
tree | 8353404b39167b55fde8adb6c3d0b24b4fccdfee /webkit/fileapi/file_system_operation_context.h | |
parent | f516f4e5d8eff9285234cf18a62108d18229367c (diff) | |
download | chromium_src-08f8feb39b2c8801dd39a1531fb5958644162e6d.zip chromium_src-08f8feb39b2c8801dd39a1531fb5958644162e6d.tar.gz chromium_src-08f8feb39b2c8801dd39a1531fb5958644162e6d.tar.bz2 |
Move src/dest info out of FileSystemOperationContext
Current FileSystemOperationContext has both src and dest path file info in it but this is making the code for cross-FileUtil operations way complex.
This patch removes src/dest information from FileSystemOperationContext and instead:
- introduce new FileSystemPath class, which represents a file path information in a filesystem
- replace all the FilePath args in FileSystemFileUtil with FileSystemPath
The resulting code still has some ugly part, and if we get rid of cross-FU operations from each FU code eventually we may end up converting FileSystemPath back to FilePath, but I think this change is not far from the way we want to go.
BUG=114732, 110121
TEST=existing tests
Review URL: http://codereview.chromium.org/9413009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123689 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/file_system_operation_context.h')
-rw-r--r-- | webkit/fileapi/file_system_operation_context.h | 73 |
1 files changed, 2 insertions, 71 deletions
diff --git a/webkit/fileapi/file_system_operation_context.h b/webkit/fileapi/file_system_operation_context.h index e61aac8..8901cb1 100644 --- a/webkit/fileapi/file_system_operation_context.h +++ b/webkit/fileapi/file_system_operation_context.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. @@ -17,91 +17,22 @@ class FileSystemContext; class FileSystemOperationContext { public: - // The |file_util| parameter is so that unit tests can force their own - // preferred class in for both src and dest FSFU; in general these will get - // set later by the FileSystemOperation. - FileSystemOperationContext(FileSystemContext* context, - FileSystemFileUtil* file_util); + FileSystemOperationContext(FileSystemContext* context); ~FileSystemOperationContext(); FileSystemContext* file_system_context() const { return file_system_context_.get(); } - void set_src_file_util(FileSystemFileUtil* util) { - DCHECK(!src_file_util_); - src_file_util_ = util; - } - - FileSystemFileUtil* src_file_util() const { - return src_file_util_; - } - - void set_dest_file_util(FileSystemFileUtil* util) { - DCHECK(!dest_file_util_); - dest_file_util_ = util; - } - - FileSystemFileUtil* dest_file_util() const { - return dest_file_util_; - } - - void set_src_origin_url(const GURL& url) { - src_origin_url_ = url; - } - - const GURL& src_origin_url() const { - return src_origin_url_; - } - - void set_dest_origin_url(const GURL& url) { - dest_origin_url_ = url; - } - - const GURL& dest_origin_url() const { - return dest_origin_url_; - } - - FileSystemType src_type() const { - return src_type_; - } - - void set_src_type(FileSystemType src_type) { - src_type_ = src_type; - } - - FileSystemType dest_type() const { - return dest_type_; - } - - void set_dest_type(FileSystemType dest_type) { - dest_type_ = dest_type; - } - void set_allowed_bytes_growth(const int64& allowed_bytes_growth) { allowed_bytes_growth_ = allowed_bytes_growth; } - int64 allowed_bytes_growth() const { return allowed_bytes_growth_; } - FileSystemOperationContext* CreateInheritedContextForDest() const; - private: scoped_refptr<FileSystemContext> file_system_context_; - // These *_file_util_ are not "owned" by FileSystemOperationContext. They - // are supposed to be pointers to objects that will outlive us. - FileSystemFileUtil* src_file_util_; - FileSystemFileUtil* dest_file_util_; - GURL src_origin_url_; // Also used for any single-path operation. - GURL dest_origin_url_; - FileSystemType src_type_; // Also used for any single-path operation. - FileSystemType dest_type_; int64 allowed_bytes_growth_; - - // Used for delayed operation by quota. - FilePath src_virtual_path_; // Also used for any single-path operation. - FilePath dest_virtual_path_; }; } // namespace fileapi |