|
|
Do not observe MessageLoop destruction from ModelSafeWorker.
BrowserThreads are being migrated to TaskScheduler which doesn't
support MessageLoop destruction observers. Destruction observers
currently serve two purposes in ModelSafeWorker:
1. Set a "stopped" flag to true. When this flag is true,
DoWorkAndWaitUntilDone() returns CANNOT_DO_WORK immediately.
-> This is useless because all DoWorkAndWaitUntilDoneImpl()
implementations already return CANNOT_DO_WORK when they
are unable to schedule a task.
For example, in
BrowserThreadModelWorker::DoWorkAndWaitUntilDoneImpl():
// Note: PostTask returns false once the MessageLoop
// running on the BrowserThread is destroyed.
if (!runner_->PostTask(
FROM_HERE,
base::Bind(...))) {
DLOG(WARNING) << "Failed to post task to runner " << runner_;
error = CANNOT_DO_WORK;
return error;
}
2. Notify SyncBackendRegistrar that the MessageLoop was
destroyed so that it can move the ModelSafeWorker to an
inactive list. When all ModelSafeWorkers have been moved to
the inactive list, SyncBackendRegistrar deletes itself.
-> There is no reason to keep SyncBackendRegistrar alive
after both SyncManager and SyncBackendHostImpl have cleared
their pointer/unique_ptr to it. With this CL,
SyncBackendRegistrar is deleted by a DeleteSoon task posted
from SyncBackendHostImpl::Shutdown().
-> Deleting SyncBackendRegistrar causes the ModelSafeWorker
references kept in |stopped_workers_| to be released. This
is not dangerous since any object that still needs to use
a ModelSafeWorker should have its own reference to it.
BUG= 650723
Committed: https://crrev.com/ea7a7eca75b39bfc9cbf72aed8a4dffa1d77f1e2
Cr-Commit-Position: refs/heads/master@{#430293}
Total comments: 7
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+123 lines, -578 lines) |
Patch |
 |
M |
chrome/browser/sync/chrome_sync_client.h
|
View
|
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/sync/chrome_sync_client.cc
|
View
|
1
|
1 chunk |
+7 lines, -9 lines |
0 comments
|
Download
|
 |
M |
components/browser_sync/profile_sync_test_util.cc
|
View
|
|
3 chunks |
+9 lines, -14 lines |
0 comments
|
Download
|
 |
M |
components/history/core/browser/history_model_worker.h
|
View
|
1
|
2 chunks |
+4 lines, -11 lines |
0 comments
|
Download
|
 |
M |
components/history/core/browser/history_model_worker.cc
|
View
|
|
2 chunks |
+4 lines, -19 lines |
0 comments
|
Download
|
 |
M |
components/password_manager/sync/browser/password_model_worker.h
|
View
|
1
|
3 chunks |
+1 line, -9 lines |
0 comments
|
Download
|
 |
M |
components/password_manager/sync/browser/password_model_worker.cc
|
View
|
|
3 chunks |
+3 lines, -14 lines |
0 comments
|
Download
|
 |
M |
components/sync/driver/fake_sync_client.h
|
View
|
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
components/sync/driver/fake_sync_client.cc
|
View
|
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
components/sync/driver/glue/browser_thread_model_worker.h
|
View
|
1
|
2 chunks |
+3 lines, -10 lines |
0 comments
|
Download
|
 |
M |
components/sync/driver/glue/browser_thread_model_worker.cc
|
View
|
|
3 chunks |
+3 lines, -13 lines |
0 comments
|
Download
|
 |
M |
components/sync/driver/glue/browser_thread_model_worker_unittest.cc
|
View
|
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
components/sync/driver/glue/sync_backend_host.h
|
View
|
1
2
|
1 chunk |
+2 lines, -8 lines |
0 comments
|
Download
|
 |
M |
components/sync/driver/glue/sync_backend_host_impl.cc
|
View
|
1
2
|
3 chunks |
+10 lines, -12 lines |
0 comments
|
Download
|
 |
M |
components/sync/driver/glue/sync_backend_host_impl_unittest.cc
|
View
|
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
components/sync/driver/glue/sync_backend_registrar.h
|
View
|
1
2
3
|
7 chunks |
+14 lines, -51 lines |
0 comments
|
Download
|
 |
M |
components/sync/driver/glue/sync_backend_registrar.cc
|
View
|
1
|
3 chunks |
+3 lines, -46 lines |
0 comments
|
Download
|
 |
M |
components/sync/driver/glue/sync_backend_registrar_unittest.cc
|
View
|
|
6 chunks |
+15 lines, -140 lines |
0 comments
|
Download
|
 |
M |
components/sync/driver/glue/ui_model_worker.h
|
View
|
|
2 chunks |
+2 lines, -8 lines |
0 comments
|
Download
|
 |
M |
components/sync/driver/glue/ui_model_worker.cc
|
View
|
|
2 chunks |
+5 lines, -11 lines |
0 comments
|
Download
|
 |
M |
components/sync/driver/glue/ui_model_worker_unittest.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
components/sync/driver/sync_client.h
|
View
|
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
components/sync/engine/model_safe_worker.h
|
View
|
1
|
5 chunks |
+10 lines, -58 lines |
0 comments
|
Download
|
 |
M |
components/sync/engine/model_safe_worker.cc
|
View
|
1
2
3
|
2 chunks |
+5 lines, -99 lines |
0 comments
|
Download
|
 |
M |
components/sync/engine/passive_model_worker.h
|
View
|
1
|
2 chunks |
+1 line, -3 lines |
0 comments
|
Download
|
 |
M |
components/sync/engine/passive_model_worker.cc
|
View
|
|
1 chunk |
+2 lines, -7 lines |
0 comments
|
Download
|
 |
M |
components/sync/test/engine/fake_model_worker.h
|
View
|
|
2 chunks |
+0 lines, -4 lines |
0 comments
|
Download
|
 |
M |
components/sync/test/engine/fake_model_worker.cc
|
View
|
|
2 chunks |
+3 lines, -6 lines |
0 comments
|
Download
|
 |
M |
components/sync/tools/sync_client.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
ios/chrome/browser/sync/ios_chrome_sync_client.h
|
View
|
1
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
ios/chrome/browser/sync/ios_chrome_sync_client.mm
|
View
|
1
|
1 chunk |
+7 lines, -9 lines |
0 comments
|
Download
|
Depends on Patchset:
Total messages: 38 (22 generated)
|