Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1192)

Unified Diff: chrome/browser/chromeos/gdata/gdata_directory_service.cc

Issue 10855243: child_files_ and child_directories_ have resource_ids instead of GDataFile* and GDataDirectory*. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_files.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/gdata_directory_service.cc
===================================================================
--- chrome/browser/chromeos/gdata/gdata_directory_service.cc (revision 152392)
+++ chrome/browser/chromeos/gdata/gdata_directory_service.cc (working copy)
@@ -300,10 +300,13 @@
GDataDirectory* current_dir = root_.get();
for (size_t i = 1; i < components.size() && current_dir; ++i) {
- GDataEntry* entry = current_dir->FindChild(components[i]);
- if (!entry)
+ std::string resource_id = current_dir->FindChild(components[i]);
+ if (resource_id.empty())
return NULL;
+ GDataEntry* entry = GetEntryByResourceId(resource_id);
+ DCHECK(entry);
+
if (i == components.size() - 1) // Last component.
return entry;
else
@@ -313,9 +316,9 @@
}
GDataEntry* GDataDirectoryService::GetEntryByResourceId(
- const std::string& resource) {
- // GDataFileSystem has already locked.
- ResourceMap::const_iterator iter = resource_map_.find(resource);
+ const std::string& resource_id) {
+ DCHECK(!resource_id.empty());
+ ResourceMap::const_iterator iter = resource_map_.find(resource_id);
return iter == resource_map_.end() ? NULL : iter->second;
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_files.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698