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

Side by Side Diff: chrome/browser/chromeos/drive/file_cache.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
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 #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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 free_space = free_disk_space_getter_->AmountOfFreeDiskSpace(); 695 free_space = free_disk_space_getter_->AmountOfFreeDiskSpace();
696 else 696 else
697 free_space = base::SysInfo::AmountOfFreeDiskSpace(path); 697 free_space = base::SysInfo::AmountOfFreeDiskSpace(path);
698 698
699 // Subtract this as if this portion does not exist. 699 // Subtract this as if this portion does not exist.
700 free_space -= kMinFreeSpace; 700 free_space -= kMinFreeSpace;
701 return (free_space >= num_bytes); 701 return (free_space >= num_bytes);
702 } 702 }
703 703
704 bool FileCache::ImportOldDB(const base::FilePath& old_db_path) { 704 bool FileCache::ImportOldDB(const base::FilePath& old_db_path) {
705 if (!file_util::PathExists(old_db_path)) // Old DB is not there, do nothing. 705 if (!base::PathExists(old_db_path)) // Old DB is not there, do nothing.
706 return false; 706 return false;
707 707
708 // Copy all entries stored in the old DB. 708 // Copy all entries stored in the old DB.
709 bool imported = false; 709 bool imported = false;
710 { 710 {
711 FileCacheMetadata old_data(blocking_task_runner_.get()); 711 FileCacheMetadata old_data(blocking_task_runner_.get());
712 if (old_data.Initialize(old_db_path) == 712 if (old_data.Initialize(old_db_path) ==
713 FileCacheMetadata::INITIALIZE_OPENED) { 713 FileCacheMetadata::INITIALIZE_OPENED) {
714 scoped_ptr<FileCacheMetadata::Iterator> it = old_data.GetIterator(); 714 scoped_ptr<FileCacheMetadata::Iterator> it = old_data.GetIterator();
715 for (; !it->IsAtEnd(); it->Advance()) { 715 for (; !it->IsAtEnd(); it->Advance()) {
(...skipping 30 matching lines...) Expand all
746 false, // not recursive 746 false, // not recursive
747 base::FileEnumerator::FILES); 747 base::FileEnumerator::FILES);
748 for (base::FilePath current = enumerator.Next(); !current.empty(); 748 for (base::FilePath current = enumerator.Next(); !current.empty();
749 current = enumerator.Next()) 749 current = enumerator.Next())
750 base::Move(current, current.RemoveExtension()); 750 base::Move(current, current.RemoveExtension());
751 } 751 }
752 } 752 }
753 753
754 } // namespace internal 754 } // namespace internal
755 } // namespace drive 755 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/fake_file_system.cc ('k') | chrome/browser/chromeos/drive/file_cache_metadata.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698