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

Side by Side Diff: components/drive/file_cache.h

Issue 1815053003: Revert of Reland: Create hard links in file migration if necessary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | components/drive/file_cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 COMPONENTS_DRIVE_FILE_CACHE_H_ 5 #ifndef COMPONENTS_DRIVE_FILE_CACHE_H_
6 #define COMPONENTS_DRIVE_FILE_CACHE_H_ 6 #define COMPONENTS_DRIVE_FILE_CACHE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 // Moves files in the cache directory which are not managed by FileCache to 151 // Moves files in the cache directory which are not managed by FileCache to
152 // |dest_directory|. 152 // |dest_directory|.
153 // |recovered_cache_info| should contain cache info recovered from the trashed 153 // |recovered_cache_info| should contain cache info recovered from the trashed
154 // metadata DB. It is used to ignore non-dirty files. 154 // metadata DB. It is used to ignore non-dirty files.
155 bool RecoverFilesFromCacheDirectory( 155 bool RecoverFilesFromCacheDirectory(
156 const base::FilePath& dest_directory, 156 const base::FilePath& dest_directory,
157 const ResourceMetadataStorage::RecoveredCacheInfoMap& 157 const ResourceMetadataStorage::RecoveredCacheInfoMap&
158 recovered_cache_info); 158 recovered_cache_info);
159 159
160 // Migrates cache files from |from| directory to |to_files| directory with 160 // Migrates cache files from |from| directory to |to| directory. Returns true
161 // creating links in |to_links| directory if necessary. Returns true for 161 // for success.
162 // success.
163 static bool MigrateCacheFiles(const base::FilePath& from, 162 static bool MigrateCacheFiles(const base::FilePath& from,
164 const base::FilePath& to_files, 163 const base::FilePath& to,
165 const base::FilePath& to_links,
166 ResourceMetadataStorage* metadata_storage); 164 ResourceMetadataStorage* metadata_storage);
167 165
168 private: 166 private:
169 friend class FileCacheTest; 167 friend class FileCacheTest;
170 168
171 ~FileCache(); 169 ~FileCache();
172 170
173 // Returns absolute path of the file if it were cached or to be cached. 171 // Returns absolute path of the file if it were cached or to be cached.
174 // 172 //
175 // Can be called on any thread. 173 // Can be called on any thread.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 // invalidate its weak pointers before any other members are destroyed. 222 // invalidate its weak pointers before any other members are destroyed.
225 // This object should be accessed only on |blocking_task_runner_|. 223 // This object should be accessed only on |blocking_task_runner_|.
226 base::WeakPtrFactory<FileCache> weak_ptr_factory_; 224 base::WeakPtrFactory<FileCache> weak_ptr_factory_;
227 DISALLOW_COPY_AND_ASSIGN(FileCache); 225 DISALLOW_COPY_AND_ASSIGN(FileCache);
228 }; 226 };
229 227
230 } // namespace internal 228 } // namespace internal
231 } // namespace drive 229 } // namespace drive
232 230
233 #endif // COMPONENTS_DRIVE_FILE_CACHE_H_ 231 #endif // COMPONENTS_DRIVE_FILE_CACHE_H_
OLDNEW
« no previous file with comments | « no previous file | components/drive/file_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698