| 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);
|
|
|