Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Side by Side Diff: chrome/browser/sync/glue/browser_thread_model_worker.cc

Issue 667573007: Revert "Sync: Avoid deadlock in SyncBackendRegistrar / ModelSafeWorker on sync backend shutdown." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/sync/glue/history_model_worker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/browser_thread_model_worker.h" 5 #include "chrome/browser/sync/glue/browser_thread_model_worker.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/synchronization/waitable_event.h" 8 #include "base/synchronization/waitable_event.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 syncer::ModelSafeGroup BrowserThreadModelWorker::GetModelSafeGroup() { 45 syncer::ModelSafeGroup BrowserThreadModelWorker::GetModelSafeGroup() {
46 return group_; 46 return group_;
47 } 47 }
48 48
49 BrowserThreadModelWorker::~BrowserThreadModelWorker() {} 49 BrowserThreadModelWorker::~BrowserThreadModelWorker() {}
50 50
51 void BrowserThreadModelWorker::RegisterForLoopDestruction() { 51 void BrowserThreadModelWorker::RegisterForLoopDestruction() {
52 if (BrowserThread::CurrentlyOn(thread_)) { 52 if (BrowserThread::CurrentlyOn(thread_)) {
53 base::MessageLoop::current()->AddDestructionObserver(this);
53 SetWorkingLoopToCurrent(); 54 SetWorkingLoopToCurrent();
54 } else { 55 } else {
55 BrowserThread::PostTask( 56 BrowserThread::PostTask(
56 thread_, FROM_HERE, 57 thread_, FROM_HERE,
57 Bind(&BrowserThreadModelWorker::RegisterForLoopDestruction, this)); 58 Bind(&BrowserThreadModelWorker::RegisterForLoopDestruction, this));
58 } 59 }
59 } 60 }
60 61
61 void BrowserThreadModelWorker::CallDoWorkAndSignalTask( 62 void BrowserThreadModelWorker::CallDoWorkAndSignalTask(
62 const syncer::WorkCallback& work, 63 const syncer::WorkCallback& work,
(...skipping 28 matching lines...) Expand all
91 void FileModelWorker::CallDoWorkAndSignalTask( 92 void FileModelWorker::CallDoWorkAndSignalTask(
92 const syncer::WorkCallback& work, 93 const syncer::WorkCallback& work,
93 WaitableEvent* done, 94 WaitableEvent* done,
94 syncer::SyncerError* error) { 95 syncer::SyncerError* error) {
95 BrowserThreadModelWorker::CallDoWorkAndSignalTask(work, done, error); 96 BrowserThreadModelWorker::CallDoWorkAndSignalTask(work, done, error);
96 } 97 }
97 98
98 FileModelWorker::~FileModelWorker() {} 99 FileModelWorker::~FileModelWorker() {}
99 100
100 } // namespace browser_sync 101 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/glue/history_model_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698