| 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/database_model_worker.h" | 5 #include "chrome/browser/sync/glue/database_model_worker.h" |
| 6 | 6 |
| 7 #include "base/waitable_event.h" |
| 7 #include "chrome/browser/chrome_thread.h" | 8 #include "chrome/browser/chrome_thread.h" |
| 8 | 9 |
| 9 using base::WaitableEvent; | 10 using base::WaitableEvent; |
| 10 | 11 |
| 11 namespace browser_sync { | 12 namespace browser_sync { |
| 12 | 13 |
| 13 void DatabaseModelWorker::DoWorkAndWaitUntilDone(Callback0::Type* work) { | 14 void DatabaseModelWorker::DoWorkAndWaitUntilDone(Callback0::Type* work) { |
| 14 if (ChromeThread::CurrentlyOn(ChromeThread::DB)) { | 15 if (ChromeThread::CurrentlyOn(ChromeThread::DB)) { |
| 15 DLOG(WARNING) << "DoWorkAndWaitUntilDone called from the DB thread."; | 16 DLOG(WARNING) << "DoWorkAndWaitUntilDone called from the DB thread."; |
| 16 work->Run(); | 17 work->Run(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 31 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); | 32 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); |
| 32 work->Run(); | 33 work->Run(); |
| 33 done->Signal(); | 34 done->Signal(); |
| 34 } | 35 } |
| 35 | 36 |
| 36 bool DatabaseModelWorker::CurrentThreadIsWorkThread() { | 37 bool DatabaseModelWorker::CurrentThreadIsWorkThread() { |
| 37 return ChromeThread::CurrentlyOn(ChromeThread::DB); | 38 return ChromeThread::CurrentlyOn(ChromeThread::DB); |
| 38 } | 39 } |
| 39 | 40 |
| 40 } // namespace browser_sync | 41 } // namespace browser_sync |
| OLD | NEW |