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

Unified Diff: sync/internal_api/public/attachments/attachment_service_impl.h

Issue 569463002: Make AttachmentServiceImpl clear backoff when reconnected to network. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master. Created 6 years, 3 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: sync/internal_api/public/attachments/attachment_service_impl.h
diff --git a/sync/internal_api/public/attachments/attachment_service_impl.h b/sync/internal_api/public/attachments/attachment_service_impl.h
index 423656be6fa3425fd23a3c22d07fc59c7b41b646..2d42b26941f27f510fb70ef0f5580b1152d23151 100644
--- a/sync/internal_api/public/attachments/attachment_service_impl.h
+++ b/sync/internal_api/public/attachments/attachment_service_impl.h
@@ -10,6 +10,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
+#include "net/base/network_change_notifier.h"
#include "sync/api/attachments/attachment_store.h"
#include "sync/internal_api/public/attachments/attachment_downloader.h"
#include "sync/internal_api/public/attachments/attachment_service.h"
@@ -20,8 +21,10 @@
namespace syncer {
// Implementation of AttachmentService.
-class SYNC_EXPORT AttachmentServiceImpl : public AttachmentService,
- public base::NonThreadSafe {
+class SYNC_EXPORT AttachmentServiceImpl
+ : public AttachmentService,
+ public net::NetworkChangeNotifier::NetworkChangeObserver,
+ public base::NonThreadSafe {
public:
// |attachment_uploader| is optional. If null, attachments will never be
// uploaded to the sync server and |delegate|'s OnAttachmentUploaded will
@@ -65,6 +68,15 @@ class SYNC_EXPORT AttachmentServiceImpl : public AttachmentService,
virtual void UploadAttachments(
const AttachmentIdSet& attachment_ids) OVERRIDE;
+ // NetworkChangeObserver implementation.
+ virtual void OnNetworkChanged(
+ net::NetworkChangeNotifier::ConnectionType type) OVERRIDE;
+
+ // Use |timer| in the underlying TaskQueue.
+ //
+ // Used in tests. See also MockTimer.
+ void SetTimerForTest(scoped_ptr<base::Timer> timer);
+
private:
class GetOrDownloadState;
« no previous file with comments | « sync/internal_api/attachments/task_queue_unittest.cc ('k') | sync/internal_api/public/attachments/task_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698