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

Unified Diff: chrome/browser/chromeos/drive/drive_integration_service.cc

Issue 23462021: Move out Drive cache file path constants outside of file_system_util.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/file_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/drive_integration_service.cc
diff --git a/chrome/browser/chromeos/drive/drive_integration_service.cc b/chrome/browser/chromeos/drive/drive_integration_service.cc
index dafcc21cfe32e869c2632e1e869c0c5b3a47a448..8a75b77471353ee71f0c801e47714934a64d5ec3 100644
--- a/chrome/browser/chromeos/drive/drive_integration_service.cc
+++ b/chrome/browser/chromeos/drive/drive_integration_service.cc
@@ -47,6 +47,17 @@ using content::BrowserThread;
namespace drive {
namespace {
+// Name of the directory used to store metadata.
+const base::FilePath::CharType kMetadataDirectory[] = FILE_PATH_LITERAL("meta");
+
+// Name of the directory used to store cached files.
+const base::FilePath::CharType kCacheFileDirectory[] =
+ FILE_PATH_LITERAL("files");
+
+// Name of the directory used to store temporary files.
+const base::FilePath::CharType kTemporaryFileDirectory[] =
+ FILE_PATH_LITERAL("tmp");
+
// Returns a user agent string used for communicating with the Drive backend,
// both WAPI and Drive API. The user agent looks like:
//
@@ -84,11 +95,11 @@ FileError InitializeMetadata(
internal::FileCache* cache,
internal::ResourceMetadata* resource_metadata) {
if (!file_util::CreateDirectory(cache_root_directory.Append(
- util::kMetadataDirectory)) ||
+ kMetadataDirectory)) ||
!file_util::CreateDirectory(cache_root_directory.Append(
- util::kCacheFileDirectory)) ||
+ kCacheFileDirectory)) ||
!file_util::CreateDirectory(cache_root_directory.Append(
- util::kTemporaryFileDirectory))) {
+ kTemporaryFileDirectory))) {
LOG(WARNING) << "Failed to create directories.";
return FILE_ERROR_FAILED;
}
@@ -96,12 +107,13 @@ FileError InitializeMetadata(
// Change permissions of cache file directory to u+rwx,og+x (711) in order to
// allow archive files in that directory to be mounted by cros-disks.
file_util::SetPosixFilePermissions(
- cache_root_directory.Append(util::kCacheFileDirectory),
+ cache_root_directory.Append(kCacheFileDirectory),
file_util::FILE_PERMISSION_USER_MASK |
file_util::FILE_PERMISSION_EXECUTE_BY_GROUP |
file_util::FILE_PERMISSION_EXECUTE_BY_OTHERS);
- util::MigrateCacheFilesFromOldDirectories(cache_root_directory);
+ util::MigrateCacheFilesFromOldDirectories(cache_root_directory,
+ kCacheFileDirectory);
if (!metadata_storage->Initialize()) {
LOG(WARNING) << "Failed to initialize the metadata storage.";
@@ -165,11 +177,11 @@ DriveIntegrationService::DriveIntegrationService(
drive_service_.get(),
blocking_task_runner_.get()));
metadata_storage_.reset(new internal::ResourceMetadataStorage(
- cache_root_directory_.Append(util::kMetadataDirectory),
+ cache_root_directory_.Append(kMetadataDirectory),
blocking_task_runner_.get()));
cache_.reset(new internal::FileCache(
metadata_storage_.get(),
- cache_root_directory_.Append(util::kCacheFileDirectory),
+ cache_root_directory_.Append(kCacheFileDirectory),
blocking_task_runner_.get(),
NULL /* free_disk_space_getter */));
drive_app_registry_.reset(new DriveAppRegistry(scheduler_.get()));
@@ -185,7 +197,7 @@ DriveIntegrationService::DriveIntegrationService(
scheduler_.get(),
resource_metadata_.get(),
blocking_task_runner_.get(),
- cache_root_directory_.Append(util::kTemporaryFileDirectory)));
+ cache_root_directory_.Append(kTemporaryFileDirectory)));
download_handler_.reset(new DownloadHandler(file_system()));
debug_info_collector_.reset(
new DebugInfoCollector(file_system(), cache_.get()));
@@ -359,7 +371,7 @@ void DriveIntegrationService::InitializeAfterMetadataInitialized(
BrowserContext::GetDownloadManager(profile_) : NULL;
download_handler_->Initialize(
download_manager,
- cache_root_directory_.Append(util::kTemporaryFileDirectory));
+ cache_root_directory_.Append(kTemporaryFileDirectory));
// Register for Google Drive invalidation notifications.
DriveNotificationManager* drive_notification_manager =
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/file_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698