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/gdata/gdata_file_system.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 1682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 | 1693 |
1694 base::PlatformFileError* error = | 1694 base::PlatformFileError* error = |
1695 new base::PlatformFileError(base::PLATFORM_FILE_OK); | 1695 new base::PlatformFileError(base::PLATFORM_FILE_OK); |
1696 FilePath* temp_file_path = new FilePath; | 1696 FilePath* temp_file_path = new FilePath; |
1697 std::string* mime_type = new std::string; | 1697 std::string* mime_type = new std::string; |
1698 GDataFileType* file_type = new GDataFileType(REGULAR_FILE); | 1698 GDataFileType* file_type = new GDataFileType(REGULAR_FILE); |
1699 PostBlockingPoolSequencedTaskAndReply( | 1699 PostBlockingPoolSequencedTaskAndReply( |
1700 kGDataFileSystemToken, | 1700 kGDataFileSystemToken, |
1701 FROM_HERE, | 1701 FROM_HERE, |
1702 base::Bind(&GDataFileSystem::CreateDocumentJsonFileOnIOThreadPool, | 1702 base::Bind(&GDataFileSystem::CreateDocumentJsonFileOnIOThreadPool, |
1703 GetGDataTempDocumentFolderPath(), | 1703 GetCacheDirectoryPath( |
| 1704 GDataRootDirectory::CACHE_TYPE_TMP_DOCUMENTS), |
1704 file_properties.alternate_url, | 1705 file_properties.alternate_url, |
1705 file_properties.resource_id, | 1706 file_properties.resource_id, |
1706 error, | 1707 error, |
1707 temp_file_path, | 1708 temp_file_path, |
1708 mime_type, | 1709 mime_type, |
1709 file_type), | 1710 file_type), |
1710 base::Bind(&RunGetFileCallbackHelper, | 1711 base::Bind(&RunGetFileCallbackHelper, |
1711 callback, | 1712 callback, |
1712 base::Owned(error), | 1713 base::Owned(error), |
1713 base::Owned(temp_file_path), | 1714 base::Owned(temp_file_path), |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1823 *has_enough_space = HasEnoughSpaceFor(num_bytes); | 1824 *has_enough_space = HasEnoughSpaceFor(num_bytes); |
1824 if (*has_enough_space) | 1825 if (*has_enough_space) |
1825 return; | 1826 return; |
1826 | 1827 |
1827 // Otherwise, try to free up the disk space. | 1828 // Otherwise, try to free up the disk space. |
1828 DVLOG(1) << "Freeing up disk space for " << num_bytes; | 1829 DVLOG(1) << "Freeing up disk space for " << num_bytes; |
1829 base::AutoLock lock(lock_); // To access the cache map. | 1830 base::AutoLock lock(lock_); // To access the cache map. |
1830 // First remove temporary files from the cache map. | 1831 // First remove temporary files from the cache map. |
1831 root_->RemoveTemporaryFilesFromCacheMap(); | 1832 root_->RemoveTemporaryFilesFromCacheMap(); |
1832 // Then remove all files under "tmp" directory. | 1833 // Then remove all files under "tmp" directory. |
1833 RemoveAllFiles(GetGDataCacheTmpDirectory()); | 1834 RemoveAllFiles(GetCacheDirectoryPath(GDataRootDirectory::CACHE_TYPE_TMP)); |
1834 | 1835 |
1835 // Check the disk space again. | 1836 // Check the disk space again. |
1836 *has_enough_space = HasEnoughSpaceFor(num_bytes); | 1837 *has_enough_space = HasEnoughSpaceFor(num_bytes); |
1837 } | 1838 } |
1838 | 1839 |
1839 void GDataFileSystem::FreeDiskSpaceIfNeeded(bool* has_enough_space) { | 1840 void GDataFileSystem::FreeDiskSpaceIfNeeded(bool* has_enough_space) { |
1840 FreeDiskSpaceIfNeededFor(0, has_enough_space); | 1841 FreeDiskSpaceIfNeededFor(0, has_enough_space); |
1841 } | 1842 } |
1842 | 1843 |
1843 void GDataFileSystem::StartDownloadFileIfEnoughSpace( | 1844 void GDataFileSystem::StartDownloadFileIfEnoughSpace( |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2015 if (regular_file) { | 2016 if (regular_file) { |
2016 properties->file_md5 = regular_file->file_md5(); | 2017 properties->file_md5 = regular_file->file_md5(); |
2017 properties->mime_type = regular_file->content_mime_type(); | 2018 properties->mime_type = regular_file->content_mime_type(); |
2018 properties->content_url = regular_file->content_url(); | 2019 properties->content_url = regular_file->content_url(); |
2019 properties->alternate_url = regular_file->alternate_url(); | 2020 properties->alternate_url = regular_file->alternate_url(); |
2020 properties->is_hosted_document = regular_file->is_hosted_document(); | 2021 properties->is_hosted_document = regular_file->is_hosted_document(); |
2021 } | 2022 } |
2022 return true; | 2023 return true; |
2023 } | 2024 } |
2024 | 2025 |
2025 bool GDataFileSystem::IsUnderGDataCacheDirectory(const FilePath& path) const { | |
2026 return gdata_cache_path_ == path || gdata_cache_path_.IsParent(path); | |
2027 } | |
2028 | |
2029 FilePath GDataFileSystem::GetGDataCacheTmpDirectory() const { | |
2030 return cache_paths_[GDataRootDirectory::CACHE_TYPE_TMP]; | |
2031 } | |
2032 | |
2033 FilePath GDataFileSystem::GetGDataTempDownloadFolderPath() const { | |
2034 return cache_paths_[GDataRootDirectory::CACHE_TYPE_TMP_DOWNLOADS]; | |
2035 } | |
2036 | |
2037 FilePath GDataFileSystem::GetGDataTempDocumentFolderPath() const { | |
2038 return cache_paths_[GDataRootDirectory::CACHE_TYPE_TMP_DOCUMENTS]; | |
2039 } | |
2040 | |
2041 FilePath GDataFileSystem::GetGDataCachePinnedDirectory() const { | |
2042 return cache_paths_[GDataRootDirectory::CACHE_TYPE_PINNED]; | |
2043 } | |
2044 | |
2045 FilePath GDataFileSystem::GetGDataCachePersistentDirectory() const { | |
2046 return cache_paths_[GDataRootDirectory::CACHE_TYPE_PERSISTENT]; | |
2047 } | |
2048 | |
2049 base::WeakPtr<GDataFileSystem> GDataFileSystem::GetWeakPtrForCurrentThread() { | 2026 base::WeakPtr<GDataFileSystem> GDataFileSystem::GetWeakPtrForCurrentThread() { |
2050 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 2027 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
2051 return ui_weak_ptr_factory_->GetWeakPtr(); | 2028 return ui_weak_ptr_factory_->GetWeakPtr(); |
2052 } else if (BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 2029 } else if (BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
2053 if (!io_weak_ptr_factory_.get()) { | 2030 if (!io_weak_ptr_factory_.get()) { |
2054 io_weak_ptr_factory_.reset( | 2031 io_weak_ptr_factory_.reset( |
2055 new base::WeakPtrFactory<GDataFileSystem>(this)); | 2032 new base::WeakPtrFactory<GDataFileSystem>(this)); |
2056 } | 2033 } |
2057 return io_weak_ptr_factory_->GetWeakPtr(); | 2034 return io_weak_ptr_factory_->GetWeakPtr(); |
2058 } | 2035 } |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2404 if (!params->callback.is_null()) { | 2381 if (!params->callback.is_null()) { |
2405 FindEntryByPathOnCallingThread(params->search_file_path, params->callback); | 2382 FindEntryByPathOnCallingThread(params->search_file_path, params->callback); |
2406 } | 2383 } |
2407 } | 2384 } |
2408 | 2385 |
2409 void GDataFileSystem::LoadRootFeedFromCache( | 2386 void GDataFileSystem::LoadRootFeedFromCache( |
2410 bool should_load_from_server, | 2387 bool should_load_from_server, |
2411 const FilePath& search_file_path, | 2388 const FilePath& search_file_path, |
2412 const FindEntryCallback& callback) { | 2389 const FindEntryCallback& callback) { |
2413 const FilePath path = | 2390 const FilePath path = |
2414 cache_paths_[GDataRootDirectory::CACHE_TYPE_META].Append( | 2391 GetCacheDirectoryPath(GDataRootDirectory::CACHE_TYPE_META).Append( |
2415 kFilesystemProtoFile); | 2392 kFilesystemProtoFile); |
2416 LoadRootFeedParams* params = new LoadRootFeedParams(search_file_path, | 2393 LoadRootFeedParams* params = new LoadRootFeedParams(search_file_path, |
2417 should_load_from_server, | 2394 should_load_from_server, |
2418 callback); | 2395 callback); |
2419 BrowserThread::GetBlockingPool()->PostTaskAndReply(FROM_HERE, | 2396 BrowserThread::GetBlockingPool()->PostTaskAndReply(FROM_HERE, |
2420 base::Bind(&LoadProtoOnIOThreadPool, path, params), | 2397 base::Bind(&LoadProtoOnIOThreadPool, path, params), |
2421 base::Bind(&GDataFileSystem::OnProtoLoaded, | 2398 base::Bind(&GDataFileSystem::OnProtoLoaded, |
2422 GetWeakPtrForCurrentThread(), | 2399 GetWeakPtrForCurrentThread(), |
2423 base::Owned(params))); | 2400 base::Owned(params))); |
2424 } | 2401 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2478 void GDataFileSystem::SaveFileSystemAsProto() { | 2455 void GDataFileSystem::SaveFileSystemAsProto() { |
2479 DVLOG(1) << "SaveFileSystemAsProto"; | 2456 DVLOG(1) << "SaveFileSystemAsProto"; |
2480 base::AutoLock lock(lock_); // To access root_. | 2457 base::AutoLock lock(lock_); // To access root_. |
2481 | 2458 |
2482 if (!ShouldSerializeFileSystemNow(root_->serialized_size(), | 2459 if (!ShouldSerializeFileSystemNow(root_->serialized_size(), |
2483 root_->last_serialized())) { | 2460 root_->last_serialized())) { |
2484 return; | 2461 return; |
2485 } | 2462 } |
2486 | 2463 |
2487 const FilePath path = | 2464 const FilePath path = |
2488 cache_paths_[GDataRootDirectory::CACHE_TYPE_META].Append( | 2465 GetCacheDirectoryPath(GDataRootDirectory::CACHE_TYPE_META).Append( |
2489 kFilesystemProtoFile); | 2466 kFilesystemProtoFile); |
2490 scoped_ptr<std::string> serialized_proto(new std::string()); | 2467 scoped_ptr<std::string> serialized_proto(new std::string()); |
2491 root_->SerializeToString(serialized_proto.get()); | 2468 root_->SerializeToString(serialized_proto.get()); |
2492 root_->set_last_serialized(base::Time::Now()); | 2469 root_->set_last_serialized(base::Time::Now()); |
2493 root_->set_serialized_size(serialized_proto->size()); | 2470 root_->set_serialized_size(serialized_proto->size()); |
2494 PostBlockingPoolSequencedTask(kGDataFileSystemToken, FROM_HERE, | 2471 PostBlockingPoolSequencedTask(kGDataFileSystemToken, FROM_HERE, |
2495 base::Bind(&SaveProtoOnIOThreadPool, path, | 2472 base::Bind(&SaveProtoOnIOThreadPool, path, |
2496 base::Passed(serialized_proto.Pass()))); | 2473 base::Passed(serialized_proto.Pass()))); |
2497 } | 2474 } |
2498 | 2475 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2603 } | 2580 } |
2604 | 2581 |
2605 void GDataFileSystem::SaveFeed(scoped_ptr<base::Value> feed, | 2582 void GDataFileSystem::SaveFeed(scoped_ptr<base::Value> feed, |
2606 const FilePath& name) { | 2583 const FilePath& name) { |
2607 InitializeCacheIfNecessary(); | 2584 InitializeCacheIfNecessary(); |
2608 | 2585 |
2609 PostBlockingPoolSequencedTask( | 2586 PostBlockingPoolSequencedTask( |
2610 kGDataFileSystemToken, | 2587 kGDataFileSystemToken, |
2611 FROM_HERE, | 2588 FROM_HERE, |
2612 base::Bind(&SaveFeedOnIOThreadPool, | 2589 base::Bind(&SaveFeedOnIOThreadPool, |
2613 cache_paths_[GDataRootDirectory::CACHE_TYPE_META].Append( | 2590 GetCacheDirectoryPath( |
2614 name), | 2591 GDataRootDirectory::CACHE_TYPE_META).Append(name), |
2615 base::Passed(&feed))); | 2592 base::Passed(&feed))); |
2616 } | 2593 } |
2617 | 2594 |
2618 void GDataFileSystem::OnRemovedDocument( | 2595 void GDataFileSystem::OnRemovedDocument( |
2619 const FileOperationCallback& callback, | 2596 const FileOperationCallback& callback, |
2620 const FilePath& file_path, | 2597 const FilePath& file_path, |
2621 GDataErrorCode status, | 2598 GDataErrorCode status, |
2622 const GURL& document_url) { | 2599 const GURL& document_url) { |
2623 base::PlatformFileError error = GDataToPlatformError(status); | 2600 base::PlatformFileError error = GDataToPlatformError(status); |
2624 | 2601 |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3305 hide_hosted_docs_ = hide; | 3282 hide_hosted_docs_ = hide; |
3306 root_path = root_->GetFilePath(); | 3283 root_path = root_->GetFilePath(); |
3307 } | 3284 } |
3308 | 3285 |
3309 // Kick of directory refresh when this setting changes. | 3286 // Kick of directory refresh when this setting changes. |
3310 NotifyDirectoryChanged(root_path); | 3287 NotifyDirectoryChanged(root_path); |
3311 } | 3288 } |
3312 | 3289 |
3313 //===================== GDataFileSystem: Cache entry points ==================== | 3290 //===================== GDataFileSystem: Cache entry points ==================== |
3314 | 3291 |
| 3292 bool GDataFileSystem::IsUnderGDataCacheDirectory(const FilePath& path) const { |
| 3293 return gdata_cache_path_ == path || gdata_cache_path_.IsParent(path); |
| 3294 } |
| 3295 |
| 3296 FilePath GDataFileSystem::GetCacheDirectoryPath( |
| 3297 GDataRootDirectory::CacheSubDirectoryType sub_dir_type) const { |
| 3298 DCHECK_LE(0, sub_dir_type); |
| 3299 DCHECK_GT(GDataRootDirectory::NUM_CACHE_TYPES, sub_dir_type); |
| 3300 return cache_paths_[sub_dir_type]; |
| 3301 } |
| 3302 |
3315 FilePath GDataFileSystem::GetCacheFilePath( | 3303 FilePath GDataFileSystem::GetCacheFilePath( |
3316 const std::string& resource_id, | 3304 const std::string& resource_id, |
3317 const std::string& md5, | 3305 const std::string& md5, |
3318 GDataRootDirectory::CacheSubDirectoryType sub_dir_type, | 3306 GDataRootDirectory::CacheSubDirectoryType sub_dir_type, |
3319 CachedFileOrigin file_origin) const { | 3307 CachedFileOrigin file_origin) const { |
3320 DCHECK(sub_dir_type != GDataRootDirectory::CACHE_TYPE_META); | 3308 DCHECK(sub_dir_type != GDataRootDirectory::CACHE_TYPE_META); |
3321 | 3309 |
3322 // Runs on any thread. | 3310 // Runs on any thread. |
3323 // Filename is formatted as resource_id.md5, i.e. resource_id is the base | 3311 // Filename is formatted as resource_id.md5, i.e. resource_id is the base |
3324 // name and md5 is the extension. | 3312 // name and md5 is the extension. |
3325 std::string base_name = util::EscapeCacheFileName(resource_id); | 3313 std::string base_name = util::EscapeCacheFileName(resource_id); |
3326 if (file_origin == CACHED_FILE_LOCALLY_MODIFIED) { | 3314 if (file_origin == CACHED_FILE_LOCALLY_MODIFIED) { |
3327 DCHECK(sub_dir_type == GDataRootDirectory::CACHE_TYPE_PERSISTENT); | 3315 DCHECK(sub_dir_type == GDataRootDirectory::CACHE_TYPE_PERSISTENT); |
3328 base_name += FilePath::kExtensionSeparator; | 3316 base_name += FilePath::kExtensionSeparator; |
3329 base_name += kLocallyModifiedFileExtension; | 3317 base_name += kLocallyModifiedFileExtension; |
3330 } else if (!md5.empty()) { | 3318 } else if (!md5.empty()) { |
3331 base_name += FilePath::kExtensionSeparator; | 3319 base_name += FilePath::kExtensionSeparator; |
3332 base_name += util::EscapeCacheFileName(md5); | 3320 base_name += util::EscapeCacheFileName(md5); |
3333 } | 3321 } |
3334 // For mounted archives the filename is formatted as resource_id.md5.mounted, | 3322 // For mounted archives the filename is formatted as resource_id.md5.mounted, |
3335 // i.e. resource_id.md5 is the base name and ".mounted" is the extension | 3323 // i.e. resource_id.md5 is the base name and ".mounted" is the extension |
3336 if (file_origin == CACHED_FILE_MOUNTED) { | 3324 if (file_origin == CACHED_FILE_MOUNTED) { |
3337 DCHECK(sub_dir_type == GDataRootDirectory::CACHE_TYPE_PERSISTENT); | 3325 DCHECK(sub_dir_type == GDataRootDirectory::CACHE_TYPE_PERSISTENT); |
3338 base_name += FilePath::kExtensionSeparator; | 3326 base_name += FilePath::kExtensionSeparator; |
3339 base_name += kMountedArchiveFileExtension; | 3327 base_name += kMountedArchiveFileExtension; |
3340 } | 3328 } |
3341 return cache_paths_[sub_dir_type].Append(base_name); | 3329 return GetCacheDirectoryPath(sub_dir_type).Append(base_name); |
3342 } | 3330 } |
3343 | 3331 |
3344 void GDataFileSystem::StoreToCache(const std::string& resource_id, | 3332 void GDataFileSystem::StoreToCache(const std::string& resource_id, |
3345 const std::string& md5, | 3333 const std::string& md5, |
3346 const FilePath& source_path, | 3334 const FilePath& source_path, |
3347 FileOperationType file_operation_type, | 3335 FileOperationType file_operation_type, |
3348 const CacheOperationCallback& callback) { | 3336 const CacheOperationCallback& callback) { |
3349 InitializeCacheIfNecessary(); | 3337 InitializeCacheIfNecessary(); |
3350 | 3338 |
3351 base::PlatformFileError* error = | 3339 base::PlatformFileError* error = |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3520 //========= GDataFileSystem: Cache tasks that ran on io thread pool ============ | 3508 //========= GDataFileSystem: Cache tasks that ran on io thread pool ============ |
3521 | 3509 |
3522 void GDataFileSystem::InitializeCacheOnIOThreadPool() { | 3510 void GDataFileSystem::InitializeCacheOnIOThreadPool() { |
3523 base::PlatformFileError error = CreateCacheDirectories(cache_paths_); | 3511 base::PlatformFileError error = CreateCacheDirectories(cache_paths_); |
3524 if (error != base::PLATFORM_FILE_OK) | 3512 if (error != base::PLATFORM_FILE_OK) |
3525 return; | 3513 return; |
3526 | 3514 |
3527 // Change permissions of cache persistent directory to u+rwx,og+x in order to | 3515 // Change permissions of cache persistent directory to u+rwx,og+x in order to |
3528 // allow archive files in that directory to be mounted by cros-disks. | 3516 // allow archive files in that directory to be mounted by cros-disks. |
3529 error = ChangeFilePermissions( | 3517 error = ChangeFilePermissions( |
3530 cache_paths_[GDataRootDirectory::CACHE_TYPE_PERSISTENT], | 3518 GetCacheDirectoryPath(GDataRootDirectory::CACHE_TYPE_PERSISTENT), |
3531 S_IRWXU | S_IXGRP | S_IXOTH); | 3519 S_IRWXU | S_IXGRP | S_IXOTH); |
3532 if (error != base::PLATFORM_FILE_OK) | 3520 if (error != base::PLATFORM_FILE_OK) |
3533 return; | 3521 return; |
3534 | 3522 |
3535 // Scan cache persistent and tmp directories to enumerate all files and create | 3523 // Scan cache persistent and tmp directories to enumerate all files and create |
3536 // corresponding entries for cache map. | 3524 // corresponding entries for cache map. |
3537 GDataRootDirectory::CacheMap cache_map; | 3525 GDataRootDirectory::CacheMap cache_map; |
3538 ScanCacheDirectory(GDataRootDirectory::CACHE_TYPE_PERSISTENT, &cache_map); | 3526 ScanCacheDirectory(GDataRootDirectory::CACHE_TYPE_PERSISTENT, &cache_map); |
3539 ScanCacheDirectory(GDataRootDirectory::CACHE_TYPE_TMP, &cache_map); | 3527 ScanCacheDirectory(GDataRootDirectory::CACHE_TYPE_TMP, &cache_map); |
3540 | 3528 |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4269 kGDataFileSystemToken, | 4257 kGDataFileSystemToken, |
4270 FROM_HERE, | 4258 FROM_HERE, |
4271 base::Bind(&GDataFileSystem::InitializeCacheOnIOThreadPool, | 4259 base::Bind(&GDataFileSystem::InitializeCacheOnIOThreadPool, |
4272 base::Unretained(this))); | 4260 base::Unretained(this))); |
4273 } | 4261 } |
4274 | 4262 |
4275 void GDataFileSystem::ScanCacheDirectory( | 4263 void GDataFileSystem::ScanCacheDirectory( |
4276 GDataRootDirectory::CacheSubDirectoryType sub_dir_type, | 4264 GDataRootDirectory::CacheSubDirectoryType sub_dir_type, |
4277 GDataRootDirectory::CacheMap* cache_map) { | 4265 GDataRootDirectory::CacheMap* cache_map) { |
4278 file_util::FileEnumerator enumerator( | 4266 file_util::FileEnumerator enumerator( |
4279 cache_paths_[sub_dir_type], | 4267 GetCacheDirectoryPath(sub_dir_type), |
4280 false, // not recursive | 4268 false, // not recursive |
4281 static_cast<file_util::FileEnumerator::FileType>( | 4269 static_cast<file_util::FileEnumerator::FileType>( |
4282 file_util::FileEnumerator::FILES | | 4270 file_util::FileEnumerator::FILES | |
4283 file_util::FileEnumerator::SHOW_SYM_LINKS), | 4271 file_util::FileEnumerator::SHOW_SYM_LINKS), |
4284 kWildCard); | 4272 kWildCard); |
4285 for (FilePath current = enumerator.Next(); !current.empty(); | 4273 for (FilePath current = enumerator.Next(); !current.empty(); |
4286 current = enumerator.Next()) { | 4274 current = enumerator.Next()) { |
4287 // Extract resource_id and md5 from filename. | 4275 // Extract resource_id and md5 from filename. |
4288 std::string resource_id; | 4276 std::string resource_id; |
4289 std::string md5; | 4277 std::string md5; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4425 pref_registrar_->Init(profile_->GetPrefs()); | 4413 pref_registrar_->Init(profile_->GetPrefs()); |
4426 pref_registrar_->Add(prefs::kDisableGDataHostedFiles, this); | 4414 pref_registrar_->Add(prefs::kDisableGDataHostedFiles, this); |
4427 } | 4415 } |
4428 | 4416 |
4429 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { | 4417 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { |
4430 delete global_free_disk_getter_for_testing; // Safe to delete NULL; | 4418 delete global_free_disk_getter_for_testing; // Safe to delete NULL; |
4431 global_free_disk_getter_for_testing = getter; | 4419 global_free_disk_getter_for_testing = getter; |
4432 } | 4420 } |
4433 | 4421 |
4434 } // namespace gdata | 4422 } // namespace gdata |
OLD | NEW |