summaryrefslogtreecommitdiffstats
path: root/base/message_loop_proxy_impl.cc
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 01:53:38 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 01:53:38 +0000
commite87b8bbba3be2889489f5b4a94b708e67d0b8c67 (patch)
tree9c2b2210ab14fbc784b04cd0467d8f8b5bf42c68 /base/message_loop_proxy_impl.cc
parent244c1077eef720364e988b013c1b9b7bd5776a92 (diff)
downloadchromium_src-e87b8bbba3be2889489f5b4a94b708e67d0b8c67.zip
chromium_src-e87b8bbba3be2889489f5b4a94b708e67d0b8c67.tar.gz
chromium_src-e87b8bbba3be2889489f5b4a94b708e67d0b8c67.tar.bz2
Reland r65996. Disallows Singletons on non-joinable thread.
Test breakages caused by this change have been fixed here or in other changelists. BUG=61753 TEST=none Review URL: http://codereview.chromium.org/5024003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66719 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop_proxy_impl.cc')
-rw-r--r--base/message_loop_proxy_impl.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/base/message_loop_proxy_impl.cc b/base/message_loop_proxy_impl.cc
index 2e0f809..7998a94 100644
--- a/base/message_loop_proxy_impl.cc
+++ b/base/message_loop_proxy_impl.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/message_loop_proxy_impl.h"
+#include "base/thread_restrictions.h"
namespace base {
@@ -45,6 +46,11 @@ bool MessageLoopProxyImpl::PostNonNestableDelayedTask(
}
bool MessageLoopProxyImpl::BelongsToCurrentThread() {
+ // We shouldn't use MessageLoop::current() since it uses LazyInstance which
+ // may be deleted by ~AtExitManager when a WorkerPool thread calls this
+ // function.
+ // http://crbug.com/63678
+ base::ThreadRestrictions::ScopedAllowSingleton allow_singleton;
AutoLock lock(message_loop_lock_);
return (target_message_loop_ &&
(MessageLoop::current() == target_message_loop_));
@@ -98,4 +104,3 @@ MessageLoopProxy::CreateForCurrentThread() {
}
} // namespace base
-