OLD | NEW |
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 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_ |
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 void set_dest_type(FileSystemType dest_type) { | 94 void set_dest_type(FileSystemType dest_type) { |
95 dest_type_ = dest_type; | 95 dest_type_ = dest_type; |
96 } | 96 } |
97 | 97 |
98 void set_allowed_bytes_growth(const int64& allowed_bytes_growth) { | 98 void set_allowed_bytes_growth(const int64& allowed_bytes_growth) { |
99 allowed_bytes_growth_ = allowed_bytes_growth; | 99 allowed_bytes_growth_ = allowed_bytes_growth; |
100 } | 100 } |
101 | 101 |
102 int64 allowed_bytes_growth() const { return allowed_bytes_growth_; } | 102 int64 allowed_bytes_growth() const { return allowed_bytes_growth_; } |
103 | 103 |
104 // TODO(dmikurube): Eliminate this flag eventually. | |
105 // This flag is temporarily prepared to allow ObfuscatedFSFU to account | |
106 // directories' cost without making actual directories. This should be | |
107 // dealed with more fundamentally. | |
108 void set_do_not_write_actually( | |
109 bool do_not_write_actually) { | |
110 do_not_write_actually_ = do_not_write_actually; | |
111 } | |
112 | |
113 bool do_not_write_actually() const { | |
114 return do_not_write_actually_; | |
115 } | |
116 | |
117 FileSystemOperationContext* CreateInheritedContextForDest() const; | 104 FileSystemOperationContext* CreateInheritedContextForDest() const; |
118 FileSystemOperationContext* CreateInheritedContextWithNewVirtualPaths( | |
119 const FilePath& new_src_virtual_path, | |
120 const FilePath& new_dest_virtual_path) const; | |
121 void ImportAllowedBytesGrowth(const FileSystemOperationContext& other); | |
122 | 105 |
123 private: | 106 private: |
124 scoped_refptr<FileSystemContext> file_system_context_; | 107 scoped_refptr<FileSystemContext> file_system_context_; |
125 // These *_file_system_file_util_ are not "owned" by | 108 // These *_file_system_file_util_ are not "owned" by |
126 // FileSystemOperationContext. They are supposed to be pointers to objects | 109 // FileSystemOperationContext. They are supposed to be pointers to objects |
127 // that will outlive us. | 110 // that will outlive us. |
128 FileSystemFileUtil* src_file_system_file_util_; | 111 FileSystemFileUtil* src_file_system_file_util_; |
129 FileSystemFileUtil* dest_file_system_file_util_; | 112 FileSystemFileUtil* dest_file_system_file_util_; |
130 | 113 |
131 GURL src_origin_url_; // Also used for any single-path operation. | 114 GURL src_origin_url_; // Also used for any single-path operation. |
132 GURL dest_origin_url_; | 115 GURL dest_origin_url_; |
133 FileSystemType src_type_; // Also used for any single-path operation. | 116 FileSystemType src_type_; // Also used for any single-path operation. |
134 FileSystemType dest_type_; | 117 FileSystemType dest_type_; |
135 int64 allowed_bytes_growth_; | 118 int64 allowed_bytes_growth_; |
136 bool do_not_write_actually_; | |
137 | 119 |
138 // Used for delayed operation by quota. | 120 // Used for delayed operation by quota. |
139 FilePath src_virtual_path_; // Also used for any single-path operation. | 121 FilePath src_virtual_path_; // Also used for any single-path operation. |
140 FilePath dest_virtual_path_; | 122 FilePath dest_virtual_path_; |
141 }; | 123 }; |
142 | 124 |
143 } // namespace fileapi | 125 } // namespace fileapi |
144 | 126 |
145 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_ | 127 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_CONTEXT_H_ |
OLD | NEW |