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

Unified Diff: components/drive/chromeos/directory_loader.cc

Issue 2910913002: WIP.
Patch Set: rebase Created 3 years, 7 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
Index: components/drive/chromeos/directory_loader.cc
diff --git a/components/drive/chromeos/directory_loader.cc b/components/drive/chromeos/directory_loader.cc
index 10dbf356754e5e2917c5cd9cc072d282ff29115a..75420a91cf08be18daa0aa27427104753534ccce 100644
--- a/components/drive/chromeos/directory_loader.cc
+++ b/components/drive/chromeos/directory_loader.cc
@@ -100,12 +100,13 @@ class DirectoryLoader::FeedFetcher {
public:
FeedFetcher(DirectoryLoader* loader,
const DirectoryFetchInfo& directory_fetch_info,
- const std::string& root_folder_id)
+ const std::string& root_folder_id,
+ const std::string& team_drive_id)
: loader_(loader),
directory_fetch_info_(directory_fetch_info),
root_folder_id_(root_folder_id),
- weak_ptr_factory_(this) {
- }
+ team_drive_id_(team_drive_id),
+ weak_ptr_factory_(this) {}
~FeedFetcher() {
}
@@ -119,7 +120,7 @@ class DirectoryLoader::FeedFetcher {
start_time_ = base::TimeTicks::Now();
loader_->scheduler_->GetFileListInDirectory(
- directory_fetch_info_.resource_id(),
+ directory_fetch_info_.resource_id(), team_drive_id_,
base::Bind(&FeedFetcher::OnFileListFetched,
weak_ptr_factory_.GetWeakPtr(), callback));
}
@@ -189,6 +190,7 @@ class DirectoryLoader::FeedFetcher {
DirectoryLoader* loader_;
DirectoryFetchInfo directory_fetch_info_;
std::string root_folder_id_;
+ std::string team_drive_id_;
base::TimeTicks start_time_;
base::ThreadChecker thread_checker_;
base::WeakPtrFactory<FeedFetcher> weak_ptr_factory_;
@@ -501,9 +503,12 @@ void DirectoryLoader::LoadDirectoryFromServer(
base::Int64ToString(
about_resource->largest_change_id()).c_str());
- FeedFetcher* fetcher = new FeedFetcher(this,
- directory_fetch_info,
- about_resource->root_folder_id());
+ // TODO(yamaguchi): Pass the right |team_drive_id| based on
+ // directory_fetch_info. Curently it doesn't support fetching a directory
+ // under Team Drives.
+ FeedFetcher* fetcher =
+ new FeedFetcher(this, directory_fetch_info,
+ about_resource->root_folder_id(), "" /* team_drive_id */);
fast_fetch_feed_fetcher_set_.insert(base::WrapUnique(fetcher));
fetcher->Run(
base::Bind(&DirectoryLoader::LoadDirectoryFromServerAfterLoad,

Powered by Google App Engine
This is Rietveld 408576698