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

Unified Diff: sync/api/attachments/attachment_store.h

Issue 548373003: Move AttachmentStore ownership to datatype (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Changes after feedback. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: sync/api/attachments/attachment_store.h
diff --git a/sync/api/attachments/attachment_store.h b/sync/api/attachments/attachment_store.h
index b8834e0251f9da2e88e368f15151b49422c783b7..d487f8cd1775673a6cc3cee53b788e9f730f6c35 100644
--- a/sync/api/attachments/attachment_store.h
+++ b/sync/api/attachments/attachment_store.h
@@ -25,10 +25,9 @@ class AttachmentId;
//
// Destroying this object does not necessarily cancel outstanding async
// operations. If you need cancel like semantics, use WeakPtr in the callbacks.
-class SYNC_EXPORT AttachmentStore {
+class SYNC_EXPORT AttachmentStore : public base::RefCounted<AttachmentStore> {
public:
AttachmentStore();
- virtual ~AttachmentStore();
// TODO(maniscalco): Consider udpating Read and Write methods to support
// resumable transfers (bug 353292).
@@ -82,6 +81,10 @@ class SYNC_EXPORT AttachmentStore {
// successfully.
virtual void Drop(const AttachmentIdList& ids,
const DropCallback& callback) = 0;
+
+ protected:
+ friend class base::RefCounted<AttachmentStore>;
+ virtual ~AttachmentStore();
};
} // namespace syncer
« no previous file with comments | « components/sync_driver/ui_data_type_controller_unittest.cc ('k') | sync/api/attachments/fake_attachment_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698