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

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

Issue 263903004: Add AttachmentUploader interface and fake implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. 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 | Annotate | Revision Log
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_UPLOADER_H_
6 #define SYNC_API_ATTACHMENTS_ATTACHMENT_UPLOADER_H_
7
8 #include "base/basictypes.h"
9 #include "base/callback.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h"
12 #include "sync/api/attachments/attachment.h"
13 #include "sync/base/sync_export.h"
14
15 namespace syncer {
16
17 // AttachmentUploader is responsible for uploading attachments to the server.
18 class SYNC_EXPORT AttachmentUploader {
19 public:
20 // The result of an UploadAttachment operation.
21 enum UploadResult {
22 UPLOAD_SUCCESS, // No error, attachment was uploaded
23 // successfully.
24 UPLOAD_UNSPECIFIED_ERROR, // An unspecified error occurred.
25 };
26
27 typedef base::Callback<void(const UploadResult&, const AttachmentId&)>
28 UploadCallback;
29
30 AttachmentUploader();
31 virtual ~AttachmentUploader();
32
33 // Upload |attachment| and invoke |callback| when done.
34 //
35 // |callback| will be invoked when the operation has completed (successfully
36 // or otherwise).
37 //
38 // |callback| will receive an UploadResult code and an updated AttachmentId
39 // |containing the server address of the newly uploaded attachment.
40 virtual void UploadAttachment(const Attachment& attachment,
41 const UploadCallback& callback) = 0;
42 };
43
44 } // namespace syncer
45
46 #endif // SYNC_API_ATTACHMENTS_ATTACHMENT_UPLOADER_H_
OLDNEW
« no previous file with comments | « components/sync_driver/generic_change_processor_unittest.cc ('k') | sync/api/attachments/attachment_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698