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

Unified Diff: chrome/browser/sync/glue/sync_backend_host.cc

Issue 6328001: sync: annotate call to join SyncCoreThread to keep ThreadRestrictions happy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: allow_io Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/sync_backend_host.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index ed363fc01934de792ca7a2be6b851c2addcd6975..fcfb8fc9626fb19ce4dcceaba8d55358d9a76f9a 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -9,6 +9,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/task.h"
+#include "base/threading/thread_restrictions.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/net/gaia/token_service.h"
@@ -240,10 +241,14 @@ void SyncBackendHost::Shutdown(bool sync_disabled) {
// thread (ui loop) can exit before DoShutdown finishes, at which point
// virtually anything the sync backend does (or the post-back to
// frontend_loop_ by our Core) will epically fail because the CRT won't be
- // initialized. For now this only ever happens at sync-enabled-Chrome exit,
- // meaning bug 1482548 applies to prolonged "waiting" that may occur in
- // DoShutdown.
- core_thread_.Stop();
+ // initialized.
+ // Since we are blocking the UI thread here, we need to turn ourselves in
+ // with the ThreadRestriction police. For sentencing and how we plan to fix
+ // this, see bug 19757.
+ {
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+ core_thread_.Stop();
+ }
registrar_.routing_info.clear();
registrar_.workers[GROUP_DB] = NULL;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698