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

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

Issue 1811933004: 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| directory. Returns true 160 // Migrates cache files from |from| directory to |to_files| directory with
161 // for success. 161 // creating links in |to_links| directory if necessary. Returns true for
162 // success.
162 static bool MigrateCacheFiles(const base::FilePath& from, 163 static bool MigrateCacheFiles(const base::FilePath& from,
163 const base::FilePath& to, 164 const base::FilePath& to_files,
165 const base::FilePath& to_links,
164 ResourceMetadataStorage* metadata_storage); 166 ResourceMetadataStorage* metadata_storage);
165 167
166 private: 168 private:
167 friend class FileCacheTest; 169 friend class FileCacheTest;
168 170
169 ~FileCache(); 171 ~FileCache();
170 172
171 // Returns absolute path of the file if it were cached or to be cached. 173 // Returns absolute path of the file if it were cached or to be cached.
172 // 174 //
173 // Can be called on any thread. 175 // Can be called on any thread.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 // invalidate its weak pointers before any other members are destroyed. 224 // invalidate its weak pointers before any other members are destroyed.
223 // This object should be accessed only on |blocking_task_runner_|. 225 // This object should be accessed only on |blocking_task_runner_|.
224 base::WeakPtrFactory<FileCache> weak_ptr_factory_; 226 base::WeakPtrFactory<FileCache> weak_ptr_factory_;
225 DISALLOW_COPY_AND_ASSIGN(FileCache); 227 DISALLOW_COPY_AND_ASSIGN(FileCache);
226 }; 228 };
227 229
228 } // namespace internal 230 } // namespace internal
229 } // namespace drive 231 } // namespace drive
230 232
231 #endif // COMPONENTS_DRIVE_FILE_CACHE_H_ 233 #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