Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_BASE_H_ | |
| 6 #define SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_BASE_H_ | |
| 7 | |
| 8 #include "base/memory/weak_ptr.h" | |
| 9 #include "sync/api/attachments/attachment_service.h" | |
| 10 #include "sync/base/sync_export.h" | |
| 11 | |
| 12 namespace syncer { | |
| 13 | |
| 14 // AttachmentServiceBase is an AttachmentService that provides WeakPtrs. It is | |
| 15 // designed to be used in conjunction with AttachmentServiceProxy. | |
| 16 class SYNC_EXPORT AttachmentServiceBase : public AttachmentService { | |
| 17 public: | |
| 18 AttachmentServiceBase(); | |
| 19 virtual ~AttachmentServiceBase(); | |
| 20 | |
| 21 // Implementation is intentionally omitted. A derived class should provide | |
| 22 // its own implementation and ensure that its WeakPtrFactory is destroyed | |
| 23 // immediately after the derived class's destructor is invoked. See | |
| 24 // SupportsWeakPtr class comment for rationale. | |
| 25 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
| |
| 26 }; | |
| 27 | |
| 28 } // namespace syncer | |
| 29 | |
| 30 #endif // SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_BASE_H_ | |
| OLD | NEW |