| 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/drive_cache.h" | 5 #include "chrome/browser/chromeos/drive/drive_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/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/sys_info.h" | 14 #include "base/sys_info.h" |
| 15 #include "chrome/browser/chromeos/drive/drive.pb.h" | 15 #include "chrome/browser/chromeos/drive/drive.pb.h" |
| 16 #include "chrome/browser/chromeos/drive/drive_cache_metadata.h" | 16 #include "chrome/browser/chromeos/drive/drive_cache_metadata.h" |
| 17 #include "chrome/browser/chromeos/drive/drive_cache_observer.h" | 17 #include "chrome/browser/chromeos/drive/drive_cache_observer.h" |
| 18 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" | 18 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/common/chrome_constants.h" | 20 #include "chrome/common/chrome_constants.h" |
| 21 #include "chrome/common/chrome_paths_internal.h" | 21 #include "chrome/common/chrome_paths_internal.h" |
| 22 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
| 23 | 23 |
| 24 using content::BrowserThread; | 24 using content::BrowserThread; |
| 25 | 25 |
| 26 namespace gdata { | 26 namespace drive { |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 const FilePath::CharType kDriveCacheVersionDir[] = FILE_PATH_LITERAL("v1"); | 29 const FilePath::CharType kDriveCacheVersionDir[] = FILE_PATH_LITERAL("v1"); |
| 30 const FilePath::CharType kDriveCacheMetaDir[] = FILE_PATH_LITERAL("meta"); | 30 const FilePath::CharType kDriveCacheMetaDir[] = FILE_PATH_LITERAL("meta"); |
| 31 const FilePath::CharType kDriveCachePinnedDir[] = FILE_PATH_LITERAL("pinned"); | 31 const FilePath::CharType kDriveCachePinnedDir[] = FILE_PATH_LITERAL("pinned"); |
| 32 const FilePath::CharType kDriveCacheOutgoingDir[] = | 32 const FilePath::CharType kDriveCacheOutgoingDir[] = |
| 33 FILE_PATH_LITERAL("outgoing"); | 33 FILE_PATH_LITERAL("outgoing"); |
| 34 const FilePath::CharType kDriveCachePersistentDir[] = | 34 const FilePath::CharType kDriveCachePersistentDir[] = |
| 35 FILE_PATH_LITERAL("persistent"); | 35 FILE_PATH_LITERAL("persistent"); |
| 36 const FilePath::CharType kDriveCacheTmpDir[] = FILE_PATH_LITERAL("tmp"); | 36 const FilePath::CharType kDriveCacheTmpDir[] = FILE_PATH_LITERAL("tmp"); |
| (...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1620 DriveCache::CacheSubDirectoryType DriveCache::GetSubDirectoryType( | 1620 DriveCache::CacheSubDirectoryType DriveCache::GetSubDirectoryType( |
| 1621 const DriveCacheEntry& cache_entry) { | 1621 const DriveCacheEntry& cache_entry) { |
| 1622 return cache_entry.is_persistent() ? CACHE_TYPE_PERSISTENT : CACHE_TYPE_TMP; | 1622 return cache_entry.is_persistent() ? CACHE_TYPE_PERSISTENT : CACHE_TYPE_TMP; |
| 1623 } | 1623 } |
| 1624 | 1624 |
| 1625 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { | 1625 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { |
| 1626 delete global_free_disk_getter_for_testing; // Safe to delete NULL; | 1626 delete global_free_disk_getter_for_testing; // Safe to delete NULL; |
| 1627 global_free_disk_getter_for_testing = getter; | 1627 global_free_disk_getter_for_testing = getter; |
| 1628 } | 1628 } |
| 1629 | 1629 |
| 1630 } // namespace gdata | 1630 } // namespace drive |
| OLD | NEW |