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

Unified Diff: chrome/browser/chromeos/drive/drive_feed_loader.cc

Issue 11418127: Pass calls to GetDocuments through the scheduler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing comment Created 8 years, 1 month 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: chrome/browser/chromeos/drive/drive_feed_loader.cc
diff --git a/chrome/browser/chromeos/drive/drive_feed_loader.cc b/chrome/browser/chromeos/drive/drive_feed_loader.cc
index 40f4e6cf53bfa1ae7522b72553ac26ec226d666b..4c12dc2f195c3ccbd05b39e21427ba07306f53a5 100644
--- a/chrome/browser/chromeos/drive/drive_feed_loader.cc
+++ b/chrome/browser/chromeos/drive/drive_feed_loader.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/chromeos/drive/drive_feed_loader_observer.h"
#include "chrome/browser/chromeos/drive/drive_feed_processor.h"
#include "chrome/browser/chromeos/drive/drive_file_system_util.h"
+#include "chrome/browser/chromeos/drive/drive_scheduler.h"
#include "chrome/browser/chromeos/drive/drive_webapps_registry.h"
#include "chrome/browser/google_apis/drive_api_parser.h"
#include "chrome/browser/google_apis/drive_api_util.h"
@@ -214,11 +215,13 @@ struct GetDocumentsUiState {
DriveFeedLoader::DriveFeedLoader(
DriveResourceMetadata* resource_metadata,
google_apis::DriveServiceInterface* drive_service,
+ DriveScheduler* scheduler,
DriveWebAppsRegistryInterface* webapps_registry,
DriveCache* cache,
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner)
: resource_metadata_(resource_metadata),
drive_service_(drive_service),
+ scheduler_(scheduler),
webapps_registry_(webapps_registry),
cache_(cache),
blocking_task_runner_(blocking_task_runner),
@@ -363,7 +366,7 @@ void DriveFeedLoader::LoadFromServer(scoped_ptr<LoadFeedParams> params) {
// base::Passed() may get evaluated first, so get a pointer to params.
LoadFeedParams* params_ptr = params.get();
if (google_apis::util::IsDriveV2ApiEnabled()) {
- drive_service_->GetDocuments(
+ scheduler_->GetDocuments(
params_ptr->feed_to_load,
params_ptr->start_changestamp,
std::string(), // No search query.
@@ -374,7 +377,7 @@ void DriveFeedLoader::LoadFromServer(scoped_ptr<LoadFeedParams> params) {
base::Passed(&params),
start_time));
} else {
- drive_service_->GetDocuments(
+ scheduler_->GetDocuments(
params_ptr->feed_to_load,
params_ptr->start_changestamp,
params_ptr->search_query,
@@ -520,7 +523,7 @@ void DriveFeedLoader::OnParseFeed(
// pointer so we can use it bellow.
LoadFeedParams* params_ptr = params.get();
// Kick off the remaining part of the feeds.
- drive_service_->GetDocuments(
+ scheduler_->GetDocuments(
next_feed_url,
params_ptr->start_changestamp,
params_ptr->search_query,
@@ -623,7 +626,7 @@ void DriveFeedLoader::OnGetChangelist(scoped_ptr<LoadFeedParams> params,
// Kick off the remaining part of the feeds.
// Extract the pointer so we can use it bellow.
LoadFeedParams* params_ptr = params.get();
- drive_service_->GetDocuments(
+ scheduler_->GetDocuments(
current_feed->next_link(),
params_ptr->start_changestamp,
std::string(), // No search query.

Powered by Google App Engine
This is Rietveld 408576698