OLD | NEW |
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 #include "chrome/browser/chromeos/drive/file_cache.h" | 5 #include "chrome/browser/chromeos/drive/file_cache.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 cache_entry.set_is_dirty(true); | 74 cache_entry.set_is_dirty(true); |
75 | 75 |
76 // Create and insert new entry into cache map. | 76 // Create and insert new entry into cache map. |
77 cache_map->insert(std::make_pair(resource_id, cache_entry)); | 77 cache_map->insert(std::make_pair(resource_id, cache_entry)); |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 // Moves the file. | 81 // Moves the file. |
82 bool MoveFile(const base::FilePath& source_path, | 82 bool MoveFile(const base::FilePath& source_path, |
83 const base::FilePath& dest_path) { | 83 const base::FilePath& dest_path) { |
84 if (!file_util::Move(source_path, dest_path)) { | 84 if (!base::Move(source_path, dest_path)) { |
85 LOG(ERROR) << "Failed to move " << source_path.value() | 85 LOG(ERROR) << "Failed to move " << source_path.value() |
86 << " to " << dest_path.value(); | 86 << " to " << dest_path.value(); |
87 return false; | 87 return false; |
88 } | 88 } |
89 DVLOG(1) << "Moved " << source_path.value() << " to " << dest_path.value(); | 89 DVLOG(1) << "Moved " << source_path.value() << " to " << dest_path.value(); |
90 return true; | 90 return true; |
91 } | 91 } |
92 | 92 |
93 // Copies the file. | 93 // Copies the file. |
94 bool CopyFile(const base::FilePath& source_path, | 94 bool CopyFile(const base::FilePath& source_path, |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 } | 831 } |
832 } | 832 } |
833 | 833 |
834 // Delete old DB. | 834 // Delete old DB. |
835 base::Delete(old_db_path, true /* recursive */ ); | 835 base::Delete(old_db_path, true /* recursive */ ); |
836 return imported; | 836 return imported; |
837 } | 837 } |
838 | 838 |
839 } // namespace internal | 839 } // namespace internal |
840 } // namespace drive | 840 } // namespace drive |
OLD | NEW |