Index: components/sync/core_impl/attachments/attachment_service_impl.cc |
diff --git a/sync/internal_api/attachments/attachment_service_impl.cc b/components/sync/core_impl/attachments/attachment_service_impl.cc |
similarity index 93% |
rename from sync/internal_api/attachments/attachment_service_impl.cc |
rename to components/sync/core_impl/attachments/attachment_service_impl.cc |
index b9e1c7ea2f0b33206fabad9a0ad01c421f277092..a713aebe7b32c6a441ebec507869be3011694ed5 100644 |
--- a/sync/internal_api/attachments/attachment_service_impl.cc |
+++ b/components/sync/core_impl/attachments/attachment_service_impl.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "sync/internal_api/public/attachments/attachment_service_impl.h" |
+#include "components/sync/core/attachments/attachment_service_impl.h" |
#include <iterator> |
#include <utility> |
@@ -13,9 +13,9 @@ |
#include "base/single_thread_task_runner.h" |
#include "base/threading/thread_task_runner_handle.h" |
#include "base/time/time.h" |
-#include "sync/api/attachments/attachment.h" |
-#include "sync/internal_api/public/attachments/fake_attachment_downloader.h" |
-#include "sync/internal_api/public/attachments/fake_attachment_uploader.h" |
+#include "components/sync/api/attachments/attachment.h" |
+#include "components/sync/core/attachments/fake_attachment_downloader.h" |
+#include "components/sync/core/attachments/fake_attachment_uploader.h" |
namespace syncer { |
@@ -65,8 +65,7 @@ AttachmentServiceImpl::GetOrDownloadState::GetOrDownloadState( |
const GetOrDownloadCallback& callback) |
: callback_(callback), retrieved_attachments_(new AttachmentMap()) { |
std::copy( |
- attachment_ids.begin(), |
- attachment_ids.end(), |
+ attachment_ids.begin(), attachment_ids.end(), |
std::inserter(in_progress_attachments_, in_progress_attachments_.end())); |
PostResultIfAllRequestsCompleted(); |
} |
@@ -100,8 +99,8 @@ void AttachmentServiceImpl::GetOrDownloadState::AddUnavailableAttachmentId( |
PostResultIfAllRequestsCompleted(); |
} |
-void |
-AttachmentServiceImpl::GetOrDownloadState::PostResultIfAllRequestsCompleted() { |
+void AttachmentServiceImpl::GetOrDownloadState:: |
+ PostResultIfAllRequestsCompleted() { |
if (in_progress_attachments_.empty()) { |
// All requests completed. Let's notify consumer. |
GetOrDownloadResult result = |
@@ -134,8 +133,7 @@ AttachmentServiceImpl::AttachmentServiceImpl( |
upload_task_queue_.reset(new TaskQueue<AttachmentId>( |
base::Bind(&AttachmentServiceImpl::BeginUpload, |
weak_ptr_factory_.GetWeakPtr()), |
- initial_backoff_delay, |
- max_backoff_delay)); |
+ initial_backoff_delay, max_backoff_delay)); |
net::NetworkChangeNotifier::AddNetworkChangeObserver(this); |
} |
@@ -184,8 +182,7 @@ void AttachmentServiceImpl::ReadDone( |
std::unique_ptr<AttachmentIdList> unavailable_attachment_ids) { |
// Add read attachments to result. |
for (AttachmentMap::const_iterator iter = attachments->begin(); |
- iter != attachments->end(); |
- ++iter) { |
+ iter != attachments->end(); ++iter) { |
state->AddAttachment(iter->second); |
} |
@@ -196,11 +193,8 @@ void AttachmentServiceImpl::ReadDone( |
// Try to download locally unavailable attachments. |
for (; iter != end; ++iter) { |
attachment_downloader_->DownloadAttachment( |
- *iter, |
- base::Bind(&AttachmentServiceImpl::DownloadDone, |
- weak_ptr_factory_.GetWeakPtr(), |
- state, |
- *iter)); |
+ *iter, base::Bind(&AttachmentServiceImpl::DownloadDone, |
+ weak_ptr_factory_.GetWeakPtr(), state, *iter)); |
} |
} else { |
// No downloader so all locally unavailable attachments are unavailable. |
@@ -323,9 +317,8 @@ void AttachmentServiceImpl::ReadDoneNowUpload( |
AttachmentMap::const_iterator end = attachments->end(); |
for (; iter != end; ++iter) { |
attachment_uploader_->UploadAttachment( |
- iter->second, |
- base::Bind(&AttachmentServiceImpl::UploadDone, |
- weak_ptr_factory_.GetWeakPtr())); |
+ iter->second, base::Bind(&AttachmentServiceImpl::UploadDone, |
+ weak_ptr_factory_.GetWeakPtr())); |
} |
} |