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

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

Issue 637413003: Sync: Avoid deadlock in SyncBackendRegistrar / ModelSafeWorker on sync backend shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor tweaks 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);
54 SetWorkingLoopToCurrent(); 53 SetWorkingLoopToCurrent();
55 } else { 54 } else {
56 BrowserThread::PostTask( 55 BrowserThread::PostTask(
57 thread_, FROM_HERE, 56 thread_, FROM_HERE,
58 Bind(&BrowserThreadModelWorker::RegisterForLoopDestruction, this)); 57 Bind(&BrowserThreadModelWorker::RegisterForLoopDestruction, this));
59 } 58 }
60 } 59 }
61 60
62 void BrowserThreadModelWorker::CallDoWorkAndSignalTask( 61 void BrowserThreadModelWorker::CallDoWorkAndSignalTask(
63 const syncer::WorkCallback& work, 62 const syncer::WorkCallback& work,
(...skipping 28 matching lines...) Expand all
92 void FileModelWorker::CallDoWorkAndSignalTask( 91 void FileModelWorker::CallDoWorkAndSignalTask(
93 const syncer::WorkCallback& work, 92 const syncer::WorkCallback& work,
94 WaitableEvent* done, 93 WaitableEvent* done,
95 syncer::SyncerError* error) { 94 syncer::SyncerError* error) {
96 BrowserThreadModelWorker::CallDoWorkAndSignalTask(work, done, error); 95 BrowserThreadModelWorker::CallDoWorkAndSignalTask(work, done, error);
97 } 96 }
98 97
99 FileModelWorker::~FileModelWorker() {} 98 FileModelWorker::~FileModelWorker() {}
100 99
101 } // namespace browser_sync 100 } // 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