OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_SYNC_GLUE_HISTORY_MODEL_WORKER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_HISTORY_MODEL_WORKER_H_ |
6 #define CHROME_BROWSER_SYNC_GLUE_HISTORY_MODEL_WORKER_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_HISTORY_MODEL_WORKER_H_ |
7 | 7 |
8 #include "sync/internal_api/public/engine/model_safe_worker.h" | 8 #include "sync/internal_api/public/engine/model_safe_worker.h" |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "chrome/browser/common/cancelable_request.h" | 15 #include "base/task/cancelable_task_tracker.h" |
16 #include "chrome/browser/history/history_db_task.h" | 16 #include "chrome/browser/history/history_db_task.h" |
17 #include "chrome/browser/history/history_service.h" | 17 #include "chrome/browser/history/history_service.h" |
18 | 18 |
19 class HistoryService; | 19 class HistoryService; |
20 | 20 |
21 namespace browser_sync { | 21 namespace browser_sync { |
22 | 22 |
23 // A syncer::ModelSafeWorker for history models that accepts requests | 23 // A syncer::ModelSafeWorker for history models that accepts requests |
24 // from the syncapi that need to be fulfilled on the history thread. | 24 // from the syncapi that need to be fulfilled on the history thread. |
25 class HistoryModelWorker : public syncer::ModelSafeWorker { | 25 class HistoryModelWorker : public syncer::ModelSafeWorker { |
(...skipping 13 matching lines...) Expand all Loading... |
39 protected: | 39 protected: |
40 virtual syncer::SyncerError DoWorkAndWaitUntilDoneImpl( | 40 virtual syncer::SyncerError DoWorkAndWaitUntilDoneImpl( |
41 const syncer::WorkCallback& work) OVERRIDE; | 41 const syncer::WorkCallback& work) OVERRIDE; |
42 | 42 |
43 private: | 43 private: |
44 virtual ~HistoryModelWorker(); | 44 virtual ~HistoryModelWorker(); |
45 | 45 |
46 const base::WeakPtr<HistoryService> history_service_; | 46 const base::WeakPtr<HistoryService> history_service_; |
47 // Helper object to make sure we don't leave tasks running on the history | 47 // Helper object to make sure we don't leave tasks running on the history |
48 // thread. | 48 // thread. |
49 CancelableRequestConsumerT<int, 0> cancelable_consumer_; | 49 scoped_ptr<base::CancelableTaskTracker> cancelable_tracker_; |
50 DISALLOW_COPY_AND_ASSIGN(HistoryModelWorker); | 50 DISALLOW_COPY_AND_ASSIGN(HistoryModelWorker); |
51 }; | 51 }; |
52 | 52 |
53 } // namespace browser_sync | 53 } // namespace browser_sync |
54 | 54 |
55 #endif // CHROME_BROWSER_SYNC_GLUE_HISTORY_MODEL_WORKER_H_ | 55 #endif // CHROME_BROWSER_SYNC_GLUE_HISTORY_MODEL_WORKER_H_ |
OLD | NEW |