forked from sanyaade-mobiledev/chromium.src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AttachmentDownloader interface, change signature of AttachmentSto…
…re::Read - AttachmentDownloader interface is similar to AttachmentUploader interface. No implementation yet. - AttachmentStore::Read guarantee should be stronger. It should attempt to read all attachments and return list of attachment ids that can't be loaded locally. Those need to be downloaded from server. R=maniscalco@chromium.org BUG=376073 Review URL: https://codereview.chromium.org/293143002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272585 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
pavely@chromium.org
committed
May 23, 2014
1 parent
c3dd338
commit 1ee3768
Showing
9 changed files
with
104 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "sync/api/attachments/attachment_downloader.h" | ||
|
||
namespace syncer { | ||
|
||
AttachmentDownloader::~AttachmentDownloader() { | ||
} | ||
|
||
} // namespace syncer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef SYNC_API_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ | ||
#define SYNC_API_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ | ||
|
||
#include "base/callback.h" | ||
#include "base/memory/scoped_ptr.h" | ||
#include "sync/api/attachments/attachment.h" | ||
#include "sync/base/sync_export.h" | ||
|
||
namespace syncer { | ||
|
||
// AttachmentDownloader is responsible for downloading attachments from server. | ||
class SYNC_EXPORT AttachmentDownloader { | ||
public: | ||
// The result of a DownloadAttachment operation. | ||
enum DownloadResult { | ||
DOWNLOAD_SUCCESS, // No error, attachment was downloaded | ||
// successfully. | ||
DOWNLOAD_UNSPECIFIED_ERROR, // An unspecified error occurred. | ||
}; | ||
|
||
typedef base::Callback<void(const DownloadResult&, scoped_ptr<Attachment>)> | ||
DownloadCallback; | ||
|
||
virtual ~AttachmentDownloader(); | ||
|
||
// Download attachment referred by |attachment_id| and invoke |callback| when | ||
// done. | ||
// | ||
// |callback| will receive a DownloadResult code and an Attachment object. If | ||
// DownloadResult is not DOWNLOAD_SUCCESS then attachment pointer is NULL. | ||
virtual void DownloadAttachment(const AttachmentId& attachment_id, | ||
const DownloadCallback& callback) = 0; | ||
}; | ||
|
||
} // namespace syncer | ||
|
||
#endif // SYNC_API_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters