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

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

Issue 10823226: Get AboutResource as account metadata for Drive V2. (Closed) Base URL: svn://svn.chromium.org/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 | « chrome/browser/chromeos/gdata/gdata_files.h ('k') | chrome/browser/chromeos/gdata/gdata_wapi_feed_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/gdata_files.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_files.cc b/chrome/browser/chromeos/gdata/gdata_files.cc
index 7e493300da8c0fd00ec537a1af6f77685de398f8..e172205602898b7570d5d7c83867a8122afbcf51 100644
--- a/chrome/browser/chromeos/gdata/gdata_files.cc
+++ b/chrome/browser/chromeos/gdata/gdata_files.cc
@@ -326,7 +326,6 @@ void GDataDirectory::AddEntry(GDataEntry* entry) {
<< ", parent resource = " << entry->parent_resource_id()
<< ", resource = " + entry->resource_id();
-
// Add entry to resource map.
if (directory_service_)
directory_service_->AddEntryToResourceMap(entry);
@@ -554,10 +553,8 @@ GDataDirectoryService::GDataDirectoryService()
origin_(UNINITIALIZED),
weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
root_.reset(new GDataDirectory(NULL, this));
- root_->set_title(kGDataRootDirectory);
- root_->SetBaseNameFromTitle();
- root_->set_resource_id(kGDataRootDirectoryResourceId);
- AddEntryToResourceMap(root_.get());
+ if (!util::IsDriveV2ApiEnabled())
+ InitializeRootEntry(kGDataRootDirectoryResourceId);
}
GDataDirectoryService::~GDataDirectoryService() {
@@ -569,6 +566,14 @@ GDataDirectoryService::~GDataDirectoryService() {
directory_service_db_.release());
}
+void GDataDirectoryService::InitializeRootEntry(const std::string& root_id) {
+ root_.reset(new GDataDirectory(NULL, this));
+ root_->set_title(kGDataRootDirectory);
+ root_->SetBaseNameFromTitle();
+ root_->set_resource_id(root_id);
+ AddEntryToResourceMap(root_.get());
+}
+
void GDataDirectoryService::ClearRoot() {
// Note that children have a reference to root_,
// so we need to delete them here.
@@ -813,7 +818,7 @@ void GDataDirectoryService::InitResourceMap(
// Get the largest changestamp.
iter = serialized_resources->find(kDBKeyLargestChangestamp);
if (iter == serialized_resources->end() ||
- !base::StringToInt(iter->second, &largest_changestamp_)) {
+ !base::StringToInt64(iter->second, &largest_changestamp_)) {
NOTREACHED() << "Could not find/parse largest_changestamp";
if (!callback.is_null())
callback.Run(GDATA_FILE_ERROR_FAILED);
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_files.h ('k') | chrome/browser/chromeos/gdata/gdata_wapi_feed_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698