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

Side by Side Diff: sync/api/attachments/attachment_downloader.h

Issue 293143002: Add AttachmentDownloader interface, change signature of AttachmentStore::Read (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes after feedback from Nick Created 6 years, 7 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
« no previous file with comments | « no previous file | sync/api/attachments/attachment_downloader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef SYNC_API_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_
6 #define SYNC_API_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_
7
8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "sync/api/attachments/attachment.h"
11 #include "sync/base/sync_export.h"
12
13 namespace syncer {
14
15 // AttachmentDownloader is responsible for downloading attachments from server.
16 class SYNC_EXPORT AttachmentDownloader {
17 public:
18 // The result of a DownloadAttachment operation.
19 enum DownloadResult {
20 DOWNLOAD_SUCCESS, // No error, attachment was downloaded
21 // successfully.
22 DOWNLOAD_UNSPECIFIED_ERROR, // An unspecified error occurred.
23 };
24
25 typedef base::Callback<void(const DownloadResult&, scoped_ptr<Attachment>)>
26 DownloadCallback;
27
28 virtual ~AttachmentDownloader();
29
30 // Download attachment referred by |attachment_id| and invoke |callback| when
31 // done.
32 //
33 // |callback| will receive a DownloadResult code and an Attachment object. If
34 // DownloadResult is not DOWNLOAD_SUCCESS then attachment pointer is NULL.
35 virtual void DownloadAttachment(const AttachmentId& attachment_id,
36 const DownloadCallback& callback) = 0;
37 };
38
39 } // namespace syncer
40
41 #endif // SYNC_API_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_
OLDNEW
« no previous file with comments | « no previous file | sync/api/attachments/attachment_downloader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698