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_files.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_files.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 md5.c_str(), | 344 md5.c_str(), |
345 CacheSubDirectoryTypeToString(sub_dir_type).c_str(), | 345 CacheSubDirectoryTypeToString(sub_dir_type).c_str(), |
346 JoinString(cache_states, ',').c_str()); | 346 JoinString(cache_states, ',').c_str()); |
347 } | 347 } |
348 | 348 |
349 // GDataRootDirectory class implementation. | 349 // GDataRootDirectory class implementation. |
350 | 350 |
351 GDataRootDirectory::GDataRootDirectory(GDataFileSystem* file_system) | 351 GDataRootDirectory::GDataRootDirectory(GDataFileSystem* file_system) |
352 : ALLOW_THIS_IN_INITIALIZER_LIST(GDataDirectory(NULL, this)), | 352 : ALLOW_THIS_IN_INITIALIZER_LIST(GDataDirectory(NULL, this)), |
353 file_system_(file_system) { | 353 file_system_(file_system) { |
354 DCHECK(file_system_); | |
355 } | 354 } |
356 | 355 |
357 GDataRootDirectory::~GDataRootDirectory() { | 356 GDataRootDirectory::~GDataRootDirectory() { |
358 STLDeleteValues(&cache_map_); | 357 STLDeleteValues(&cache_map_); |
359 cache_map_.clear(); | 358 cache_map_.clear(); |
360 | 359 |
361 resource_map_.clear(); | 360 resource_map_.clear(); |
362 } | 361 } |
363 | 362 |
364 GDataRootDirectory* GDataRootDirectory::AsGDataRootDirectory() { | 363 GDataRootDirectory* GDataRootDirectory::AsGDataRootDirectory() { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 DVLOG(1) << "Found entry for res_id=" << resource_id | 483 DVLOG(1) << "Found entry for res_id=" << resource_id |
485 << ", " << entry->ToString(); | 484 << ", " << entry->ToString(); |
486 | 485 |
487 return entry; | 486 return entry; |
488 } | 487 } |
489 | 488 |
490 void GDataRootDirectory::GetCacheState( | 489 void GDataRootDirectory::GetCacheState( |
491 const std::string& resource_id, | 490 const std::string& resource_id, |
492 const std::string& md5, | 491 const std::string& md5, |
493 const GetCacheStateCallback& callback) { | 492 const GetCacheStateCallback& callback) { |
494 file_system_->GetCacheState(resource_id, md5, callback); | 493 if (file_system_) |
| 494 file_system_->GetCacheState(resource_id, md5, callback); |
495 } | 495 } |
496 | 496 |
497 } // namespace gdata | 497 } // namespace gdata |
OLD | NEW |