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

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

Issue 187303006: Update sync API to support attachments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@attachmentapi
Patch Set: Add AttachmentServiceBase allowing us to drop AsWeakPtr and RefCountedThreadSafe from AttachmentServiceProxy. Created 6 years, 9 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
« no previous file with comments | « sync/api/attachments/attachment_service.cc ('k') | sync/api/attachments/attachment_service_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/api/attachments/attachment_service_base.h
diff --git a/sync/api/attachments/attachment_service_base.h b/sync/api/attachments/attachment_service_base.h
new file mode 100644
index 0000000000000000000000000000000000000000..5d89446e59aa0289878aaa4b6c05f85c354ee399
--- /dev/null
+++ b/sync/api/attachments/attachment_service_base.h
@@ -0,0 +1,30 @@
+// 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_SERVICE_BASE_H_
+#define SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_BASE_H_
+
+#include "base/memory/weak_ptr.h"
+#include "sync/api/attachments/attachment_service.h"
+#include "sync/base/sync_export.h"
+
+namespace syncer {
+
+// AttachmentServiceBase is an AttachmentService that provides WeakPtrs. It is
+// designed to be used in conjunction with AttachmentServiceProxy.
+class SYNC_EXPORT AttachmentServiceBase : public AttachmentService {
+ public:
+ AttachmentServiceBase();
+ virtual ~AttachmentServiceBase();
+
+ // Implementation is intentionally omitted. A derived class should provide
+ // its own implementation and ensure that its WeakPtrFactory is destroyed
+ // immediately after the derived class's destructor is invoked. See
+ // SupportsWeakPtr class comment for rationale.
+ virtual base::WeakPtr<AttachmentServiceBase> AsWeakPtr() = 0;
tim (not reviewing) 2014/03/27 17:01:44 The more I look at it, the less I think of this as
maniscalco 2014/03/27 17:36:24 I like this approach. It's nice to eliminate Atta
+};
+
+} // namespace syncer
+
+#endif // SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_BASE_H_
« no previous file with comments | « sync/api/attachments/attachment_service.cc ('k') | sync/api/attachments/attachment_service_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698