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