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_cache.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_cache.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/chromeos/chromeos_version.h" | 9 #include "base/chromeos/chromeos_version.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 DCHECK(cache_entry); | 330 DCHECK(cache_entry); |
331 | 331 |
332 if (!callback.is_null()) | 332 if (!callback.is_null()) |
333 callback.Run(*success, *cache_entry); | 333 callback.Run(*success, *cache_entry); |
334 } | 334 } |
335 | 335 |
336 } // namespace | 336 } // namespace |
337 | 337 |
338 std::string GDataCache::CacheEntry::ToString() const { | 338 std::string GDataCache::CacheEntry::ToString() const { |
339 std::vector<std::string> cache_states; | 339 std::vector<std::string> cache_states; |
340 if (GDataCache::IsCachePresent(cache_state)) | 340 if (IsPresent()) |
341 cache_states.push_back("present"); | 341 cache_states.push_back("present"); |
342 if (GDataCache::IsCachePinned(cache_state)) | 342 if (IsPinned()) |
343 cache_states.push_back("pinned"); | 343 cache_states.push_back("pinned"); |
344 if (GDataCache::IsCacheDirty(cache_state)) | 344 if (IsDirty()) |
345 cache_states.push_back("dirty"); | 345 cache_states.push_back("dirty"); |
346 if (GDataCache::IsCachePersistent(cache_state)) | 346 if (IsPersistent()) |
347 cache_states.push_back("persistent"); | 347 cache_states.push_back("persistent"); |
348 | 348 |
349 return base::StringPrintf("md5=%s, cache_state=%s", | 349 return base::StringPrintf("md5=%s, cache_state=%s", |
350 md5.c_str(), | 350 md5.c_str(), |
351 JoinString(cache_states, ',').c_str()); | 351 JoinString(cache_states, ',').c_str()); |
352 } | 352 } |
353 | 353 |
354 GDataCache::GDataCache( | 354 GDataCache::GDataCache( |
355 const FilePath& cache_root_path, | 355 const FilePath& cache_root_path, |
356 base::SequencedWorkerPool* pool, | 356 base::SequencedWorkerPool* pool, |
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1571 } | 1571 } |
1572 return success; | 1572 return success; |
1573 } | 1573 } |
1574 | 1574 |
1575 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { | 1575 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { |
1576 delete global_free_disk_getter_for_testing; // Safe to delete NULL; | 1576 delete global_free_disk_getter_for_testing; // Safe to delete NULL; |
1577 global_free_disk_getter_for_testing = getter; | 1577 global_free_disk_getter_for_testing = getter; |
1578 } | 1578 } |
1579 | 1579 |
1580 } // namespace gdata | 1580 } // namespace gdata |
OLD | NEW |