| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
| 9 #include "base/task.h" | 9 #include "base/task.h" |
| 10 #include "base/waitable_event.h" | 10 #include "base/waitable_event.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 HistoryModelWorker::HistoryModelWorker(HistoryService* history_service) | 40 HistoryModelWorker::HistoryModelWorker(HistoryService* history_service) |
| 41 : history_service_(history_service) { | 41 : history_service_(history_service) { |
| 42 } | 42 } |
| 43 | 43 |
| 44 HistoryModelWorker::~HistoryModelWorker() { | 44 HistoryModelWorker::~HistoryModelWorker() { |
| 45 } | 45 } |
| 46 | 46 |
| 47 void HistoryModelWorker::DoWorkAndWaitUntilDone(Callback0::Type* work) { | 47 void HistoryModelWorker::DoWorkAndWaitUntilDone(Callback0::Type* work) { |
| 48 WaitableEvent done(false, false); | 48 WaitableEvent done(false, false); |
| 49 scoped_refptr<WorkerTask> task = new WorkerTask(work, &done); | 49 scoped_refptr<WorkerTask> task(new WorkerTask(work, &done)); |
| 50 history_service_->ScheduleDBTask(task.get(), this); | 50 history_service_->ScheduleDBTask(task.get(), this); |
| 51 done.Wait(); | 51 done.Wait(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool HistoryModelWorker::CurrentThreadIsWorkThread() { | 54 bool HistoryModelWorker::CurrentThreadIsWorkThread() { |
| 55 // TODO(ncarter): How to determine this? | 55 // TODO(ncarter): How to determine this? |
| 56 return true; | 56 return true; |
| 57 } | 57 } |
| 58 | 58 |
| 59 } // namespace browser_sync | 59 } // namespace browser_sync |
| OLD | NEW |