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_ |