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

Side by Side Diff: sync/internal_api/attachments/attachment_service_impl.cc

Issue 436373002: Move non-API code out of sync/api/attachments/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Apply CR feedback. Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sync/api/attachments/attachment_service_impl.h" 5 #include "sync/internal_api/public/attachments/attachment_service_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "sync/api/attachments/attachment.h" 10 #include "sync/api/attachments/attachment.h"
11 #include "sync/api/attachments/fake_attachment_store.h"
11 #include "sync/internal_api/public/attachments/fake_attachment_downloader.h" 12 #include "sync/internal_api/public/attachments/fake_attachment_downloader.h"
12 #include "sync/internal_api/public/attachments/fake_attachment_store.h"
13 #include "sync/internal_api/public/attachments/fake_attachment_uploader.h" 13 #include "sync/internal_api/public/attachments/fake_attachment_uploader.h"
14 14
15 namespace syncer { 15 namespace syncer {
16 16
17 // GetOrDownloadAttachments starts multiple parallel DownloadAttachment calls. 17 // GetOrDownloadAttachments starts multiple parallel DownloadAttachment calls.
18 // GetOrDownloadState tracks completion of these calls and posts callback for 18 // GetOrDownloadState tracks completion of these calls and posts callback for
19 // consumer once all attachments are either retrieved or reported unavailable. 19 // consumer once all attachments are either retrieved or reported unavailable.
20 class AttachmentServiceImpl::GetOrDownloadState 20 class AttachmentServiceImpl::GetOrDownloadState
21 : public base::RefCounted<GetOrDownloadState>, 21 : public base::RefCounted<GetOrDownloadState>,
22 public base::NonThreadSafe { 22 public base::NonThreadSafe {
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 const AttachmentDownloader::DownloadResult& result, 255 const AttachmentDownloader::DownloadResult& result,
256 scoped_ptr<Attachment> attachment) { 256 scoped_ptr<Attachment> attachment) {
257 if (result == AttachmentDownloader::DOWNLOAD_SUCCESS) { 257 if (result == AttachmentDownloader::DOWNLOAD_SUCCESS) {
258 state->AddAttachment(*attachment.get()); 258 state->AddAttachment(*attachment.get());
259 } else { 259 } else {
260 state->AddUnavailableAttachmentId(attachment_id); 260 state->AddUnavailableAttachmentId(attachment_id);
261 } 261 }
262 } 262 }
263 263
264 } // namespace syncer 264 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/attachments/attachment_service.cc ('k') | sync/internal_api/attachments/attachment_service_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698