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

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

Issue 11343004: drive: Add "Delta Update Status" section to chrome:drive-internals (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 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: chrome/browser/chromeos/drive/drive_file_system.cc
diff --git a/chrome/browser/chromeos/drive/drive_file_system.cc b/chrome/browser/chromeos/drive/drive_file_system.cc
index f4aa1d64d92e15a7a7b1cae011b702188531cb7d..be9d3ef0a33ff44b57f781bb5297b873346b6d00 100644
--- a/chrome/browser/chromeos/drive/drive_file_system.cc
+++ b/chrome/browser/chromeos/drive/drive_file_system.cc
@@ -344,12 +344,14 @@ DriveFileSystem::DriveFileSystem(
drive_service_(drive_service),
webapps_registry_(webapps_registry),
update_timer_(true /* retain_user_task */, true /* is_repeating */),
+ last_update_check_error_(DRIVE_FILE_OK),
hide_hosted_docs_(false),
blocking_task_runner_(blocking_task_runner),
scheduler_(new DriveScheduler(profile, &drive_operations_)),
+ polling_interval_sec_(kFastPollingIntervalInSec),
+ push_notification_enabled_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(ui_weak_ptr_factory_(this)),
- ui_weak_ptr_(ui_weak_ptr_factory_.GetWeakPtr()),
- polling_interval_sec_(kFastPollingIntervalInSec) {
+ ui_weak_ptr_(ui_weak_ptr_factory_.GetWeakPtr()) {
// Should be created from the file browser extension API on UI thread.
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
@@ -411,6 +413,8 @@ void DriveFileSystem::CheckForUpdates() {
void DriveFileSystem::OnUpdateChecked(DriveFileError error) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DVLOG(1) << "CheckForUpdates finished: " << error;
+ last_update_check_time_ = base::Time::Now();
+ last_update_check_error_ = error;
}
DriveFileSystem::~DriveFileSystem() {
@@ -472,6 +476,7 @@ void DriveFileSystem::StopPolling() {
}
void DriveFileSystem::SetPushNotificationEnabled(bool enabled) {
+ push_notification_enabled_ = enabled;
polling_interval_sec_ = enabled ? kSlowPollingIntervalInSec :
kFastPollingIntervalInSec;
}
@@ -2139,6 +2144,13 @@ DriveFileSystemMetadata DriveFileSystem::GetMetadata() const {
"INITIALIZED" : "UNINITIALIZED";
if (feed_loader_->refreshing())
metadata.origin += " (refreshing)";
+
+ // Metadata related to delta update.
+ metadata.push_notification_enabled = push_notification_enabled_;
+ metadata.polling_interval_sec = polling_interval_sec_;
+ metadata.last_update_check_time = last_update_check_time_;
+ metadata.last_update_check_error = last_update_check_error_;
+
return metadata;
}
« no previous file with comments | « chrome/browser/chromeos/drive/drive_file_system.h ('k') | chrome/browser/chromeos/drive/drive_file_system_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698