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/drive/resource_metadata.h" | 5 #include "chrome/browser/chromeos/drive/resource_metadata.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
10 #include "chrome/browser/chromeos/drive/drive.pb.h" | 10 #include "chrome/browser/chromeos/drive/drive.pb.h" |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 for (size_t i = 0; i < children.size(); ++i) { | 432 for (size_t i = 0; i < children.size(); ++i) { |
433 ResourceEntry entry; | 433 ResourceEntry entry; |
434 if (storage_->GetEntry(children[i], &entry) && | 434 if (storage_->GetEntry(children[i], &entry) && |
435 entry.file_info().is_directory()) { | 435 entry.file_info().is_directory()) { |
436 sub_directories->insert(GetFilePath(children[i])); | 436 sub_directories->insert(GetFilePath(children[i])); |
437 GetSubDirectoriesRecursively(children[i], sub_directories); | 437 GetSubDirectoriesRecursively(children[i], sub_directories); |
438 } | 438 } |
439 } | 439 } |
440 } | 440 } |
441 | 441 |
442 std::string ResourceMetadata::GetChildResourceId( | 442 std::string ResourceMetadata::GetChildId(const std::string& parent_local_id, |
443 const std::string& parent_local_id, | 443 const std::string& base_name) { |
444 const std::string& base_name) { | |
445 DCHECK(blocking_task_runner_->RunsTasksOnCurrentThread()); | 444 DCHECK(blocking_task_runner_->RunsTasksOnCurrentThread()); |
446 return storage_->GetChild(parent_local_id, base_name); | 445 return storage_->GetChild(parent_local_id, base_name); |
447 } | 446 } |
448 | 447 |
449 scoped_ptr<ResourceMetadata::Iterator> ResourceMetadata::GetIterator() { | 448 scoped_ptr<ResourceMetadata::Iterator> ResourceMetadata::GetIterator() { |
450 DCHECK(blocking_task_runner_->RunsTasksOnCurrentThread()); | 449 DCHECK(blocking_task_runner_->RunsTasksOnCurrentThread()); |
451 | 450 |
452 return storage_->GetIterator(); | 451 return storage_->GetIterator(); |
453 } | 452 } |
454 | 453 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 for (size_t i = 0; i < children.size(); ++i) { | 614 for (size_t i = 0; i < children.size(); ++i) { |
616 if (!RemoveEntryRecursively(children[i])) | 615 if (!RemoveEntryRecursively(children[i])) |
617 return false; | 616 return false; |
618 } | 617 } |
619 } | 618 } |
620 return storage_->RemoveEntry(id); | 619 return storage_->RemoveEntry(id); |
621 } | 620 } |
622 | 621 |
623 } // namespace internal | 622 } // namespace internal |
624 } // namespace drive | 623 } // namespace drive |
OLD | NEW |