| 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 #include "chrome/browser/sync/glue/history_model_worker.h" | 5 #include "chrome/browser/sync/glue/history_model_worker.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 syncer::SyncerError* error_; | 41 syncer::SyncerError* error_; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 class AddDBThreadObserverTask : public history::HistoryDBTask { | 44 class AddDBThreadObserverTask : public history::HistoryDBTask { |
| 45 public: | 45 public: |
| 46 AddDBThreadObserverTask(HistoryModelWorker* history_worker) | 46 AddDBThreadObserverTask(HistoryModelWorker* history_worker) |
| 47 : history_worker_(history_worker) {} | 47 : history_worker_(history_worker) {} |
| 48 | 48 |
| 49 virtual bool RunOnDBThread(history::HistoryBackend* backend, | 49 virtual bool RunOnDBThread(history::HistoryBackend* backend, |
| 50 history::HistoryDatabase* db) OVERRIDE { | 50 history::HistoryDatabase* db) OVERRIDE { |
| 51 MessageLoop::current()->AddDestructionObserver(history_worker_.get()); | 51 base::MessageLoop::current()->AddDestructionObserver(history_worker_.get()); |
| 52 return true; | 52 return true; |
| 53 } | 53 } |
| 54 | 54 |
| 55 virtual void DoneRunOnMainThread() OVERRIDE {} | 55 virtual void DoneRunOnMainThread() OVERRIDE {} |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 virtual ~AddDBThreadObserverTask() {} | 58 virtual ~AddDBThreadObserverTask() {} |
| 59 | 59 |
| 60 scoped_refptr<HistoryModelWorker> history_worker_; | 60 scoped_refptr<HistoryModelWorker> history_worker_; |
| 61 }; | 61 }; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 return error; | 110 return error; |
| 111 } | 111 } |
| 112 | 112 |
| 113 syncer::ModelSafeGroup HistoryModelWorker::GetModelSafeGroup() { | 113 syncer::ModelSafeGroup HistoryModelWorker::GetModelSafeGroup() { |
| 114 return syncer::GROUP_HISTORY; | 114 return syncer::GROUP_HISTORY; |
| 115 } | 115 } |
| 116 | 116 |
| 117 HistoryModelWorker::~HistoryModelWorker() {} | 117 HistoryModelWorker::~HistoryModelWorker() {} |
| 118 | 118 |
| 119 } // namespace browser_sync | 119 } // namespace browser_sync |
| OLD | NEW |