summaryrefslogtreecommitdiffstats
path: root/base/threading
diff options
context:
space:
mode:
authorwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-18 08:15:46 +0000
committerwangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-18 08:15:46 +0000
commitf9be1053de943283ec72f4dbf2e6fce78fd2fea1 (patch)
treeda4167c6cb28be7ca77528582a73ca7d30947f3f /base/threading
parentc96388356c1a0a9a4ee19d15ad7f2f904a4d8bab (diff)
downloadchromium_src-f9be1053de943283ec72f4dbf2e6fce78fd2fea1.zip
chromium_src-f9be1053de943283ec72f4dbf2e6fce78fd2fea1.tar.gz
chromium_src-f9be1053de943283ec72f4dbf2e6fce78fd2fea1.tar.bz2
Fix --trace-shutdown with thread-local tracing.
With thread-local tracing (r221766), TraceLog::Flush() is async and needs to be called from a thread having a message loop. It also requires that tracing has been stopped. BrowserShutdownProfileDumper is a special caller that TraceLog::Flush() was originally called from a thread without message loop. Now start another thread for flushing, and call TraceLog::SetDisabled() before TraceLog::Flush(). The calling thread needs to wait for the completion of the flush, otherwise the browser may shutdown before all trace events written. Temporarily allow the thread to wait in ThreadRestrictions. BUG=none TEST=manual run chrome with --trace-shutdown. Should not assert. Should generate correct trace file. Review URL: https://chromiumcodereview.appspot.com/24047007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223819 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/threading')
-rw-r--r--base/threading/thread_restrictions.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h
index bc25d6a..f52e64c 100644
--- a/base/threading/thread_restrictions.h
+++ b/base/threading/thread_restrictions.h
@@ -42,6 +42,7 @@ class Predictor;
}
namespace content {
class BrowserGpuChannelHostFactory;
+class BrowserShutdownProfileDumper;
class BrowserTestBase;
class GLHelper;
class GpuChannelHost;
@@ -176,6 +177,7 @@ class BASE_EXPORT ThreadRestrictions {
private:
// DO NOT ADD ANY OTHER FRIEND STATEMENTS, talk to jam or brettw first.
// BEGIN ALLOWED USAGE.
+ friend class content::BrowserShutdownProfileDumper;
friend class content::BrowserTestBase;
friend class content::NestedMessagePumpAndroid;
friend class content::RenderWidgetHelper;