| Index: sync/internal_api/attachments/attachment_service_impl.cc
|
| diff --git a/sync/internal_api/attachments/attachment_service_impl.cc b/sync/internal_api/attachments/attachment_service_impl.cc
|
| index 5ba540b188d684c66f9bcf4d1bab407f11aab820..227fd8be25a03ff4f3ecff3c0e087a1ff586f7d4 100644
|
| --- a/sync/internal_api/attachments/attachment_service_impl.cc
|
| +++ b/sync/internal_api/attachments/attachment_service_impl.cc
|
| @@ -134,10 +134,13 @@ AttachmentServiceImpl::AttachmentServiceImpl(
|
| weak_ptr_factory_.GetWeakPtr()),
|
| initial_backoff_delay,
|
| max_backoff_delay));
|
| +
|
| + net::NetworkChangeNotifier::AddNetworkChangeObserver(this);
|
| }
|
|
|
| AttachmentServiceImpl::~AttachmentServiceImpl() {
|
| DCHECK(CalledOnValidThread());
|
| + net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
|
| }
|
|
|
| // Static.
|
| @@ -288,6 +291,13 @@ void AttachmentServiceImpl::UploadAttachments(
|
| }
|
| }
|
|
|
| +void AttachmentServiceImpl::OnNetworkChanged(
|
| + net::NetworkChangeNotifier::ConnectionType type) {
|
| + if (type != net::NetworkChangeNotifier::CONNECTION_NONE) {
|
| + upload_task_queue_->ResetBackoff();
|
| + }
|
| +}
|
| +
|
| void AttachmentServiceImpl::ReadDoneNowUpload(
|
| const AttachmentStore::Result& result,
|
| scoped_ptr<AttachmentMap> attachments,
|
| @@ -313,4 +323,8 @@ void AttachmentServiceImpl::ReadDoneNowUpload(
|
| }
|
| }
|
|
|
| +void AttachmentServiceImpl::SetTimerForTest(scoped_ptr<base::Timer> timer) {
|
| + upload_task_queue_->SetTimerForTest(timer.Pass());
|
| +}
|
| +
|
| } // namespace syncer
|
|
|