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

Side by Side Diff: components/sync/core/attachments/attachment_uploader.h

Issue 2399953002: [Sync] Move attachments code out of core/. (Closed)
Patch Set: Address comments. Created 4 years, 2 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
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 COMPONENTS_SYNC_CORE_ATTACHMENTS_ATTACHMENT_UPLOADER_H_
6 #define COMPONENTS_SYNC_CORE_ATTACHMENTS_ATTACHMENT_UPLOADER_H_
7
8 #include "base/callback.h"
9 #include "components/sync/api/attachments/attachment.h"
10
11 namespace syncer {
12
13 // AttachmentUploader is responsible for uploading attachments to the server.
14 class AttachmentUploader {
15 public:
16 // The result of an UploadAttachment operation.
17 enum UploadResult {
18 UPLOAD_SUCCESS, // No error, attachment was uploaded
19 // successfully.
20 UPLOAD_TRANSIENT_ERROR, // A transient error occurred, try again later.
21 UPLOAD_UNSPECIFIED_ERROR, // An unspecified error occurred.
22 };
23
24 typedef base::Callback<void(const UploadResult&, const AttachmentId&)>
25 UploadCallback;
26
27 AttachmentUploader();
28 virtual ~AttachmentUploader();
29
30 // Upload |attachment| and invoke |callback| when done.
31 //
32 // |callback| will be invoked when the operation has completed (successfully
33 // or otherwise).
34 //
35 // |callback| will receive an UploadResult code and the AttachmentId of the
36 // newly uploaded attachment.
37 virtual void UploadAttachment(const Attachment& attachment,
38 const UploadCallback& callback) = 0;
39 };
40
41 } // namespace syncer
42
43 #endif // COMPONENTS_SYNC_CORE_ATTACHMENTS_ATTACHMENT_UPLOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698