| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_PROXY_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVICE_PROXY_H_ |
| 6 #define SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_PROXY_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVICE_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/sequenced_task_runner.h" | 12 #include "base/sequenced_task_runner.h" |
| 13 #include "base/task_runner.h" | 13 #include "base/task_runner.h" |
| 14 #include "sync/api/attachments/attachment.h" | 14 #include "sync/api/attachments/attachment.h" |
| 15 #include "sync/api/attachments/attachment_service.h" | |
| 16 #include "sync/base/sync_export.h" | 15 #include "sync/base/sync_export.h" |
| 16 #include "sync/internal_api/public/attachments/attachment_service.h" |
| 17 | 17 |
| 18 namespace syncer { | 18 namespace syncer { |
| 19 | 19 |
| 20 class SyncData; | |
| 21 | |
| 22 // AttachmentServiceProxy wraps an AttachmentService allowing multiple threads | 20 // AttachmentServiceProxy wraps an AttachmentService allowing multiple threads |
| 23 // to share the wrapped AttachmentService and invoke its methods in the | 21 // to share the wrapped AttachmentService and invoke its methods in the |
| 24 // appropriate thread. | 22 // appropriate thread. |
| 25 // | 23 // |
| 26 // Callbacks passed to methods on this class will be invoked in the same thread | 24 // Callbacks passed to methods on this class will be invoked in the same thread |
| 27 // from which the method was called. | 25 // from which the method was called. |
| 28 // | 26 // |
| 29 // This class does not own its wrapped AttachmentService object. This class | 27 // This class does not own its wrapped AttachmentService object. This class |
| 30 // holds a WeakPtr to the wrapped object. Once the the wrapped object is | 28 // holds a WeakPtr to the wrapped object. Once the the wrapped object is |
| 31 // destroyed, method calls on this object will be no-ops. | 29 // destroyed, method calls on this object will be no-ops. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 const scoped_refptr<base::SequencedTaskRunner>& wrapped_task_runner, | 103 const scoped_refptr<base::SequencedTaskRunner>& wrapped_task_runner, |
| 106 const scoped_refptr<Core>& core); | 104 const scoped_refptr<Core>& core); |
| 107 | 105 |
| 108 private: | 106 private: |
| 109 scoped_refptr<base::SequencedTaskRunner> wrapped_task_runner_; | 107 scoped_refptr<base::SequencedTaskRunner> wrapped_task_runner_; |
| 110 scoped_refptr<Core> core_; | 108 scoped_refptr<Core> core_; |
| 111 }; | 109 }; |
| 112 | 110 |
| 113 } // namespace syncer | 111 } // namespace syncer |
| 114 | 112 |
| 115 #endif // SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_PROXY_H_ | 113 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_SERVICE_PROXY_H_ |
| OLD | NEW |