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

Unified Diff: content/browser/trace_subscriber_stdio.cc

Issue 9333003: Use FILE thread for disk operations in TraceSubscriberStdio (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 | content/browser/trace_subscriber_stdio_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/trace_subscriber_stdio.cc
===================================================================
--- content/browser/trace_subscriber_stdio.cc (revision 120564)
+++ content/browser/trace_subscriber_stdio.cc (working copy)
@@ -21,6 +21,10 @@
bool TraceSubscriberStdio::OpenFile(const FilePath& path) {
LOG(INFO) << "Logging performance trace to file: " << path.value();
CloseFile();
+
+ // We're in the UI thread, so creating a file is not a great thing to do!
+ // But TraceEvent is not an end user feature, so let's disable the check.
+ base::ThreadRestrictions::ScopedAllowIO scoped_allow_io;
jam 2012/02/06 20:25:29 the goal is to eventually remove ThreadRestriction
joth 2012/02/07 09:14:59 I understand what you're saying here, but several
jam 2012/02/17 23:56:34 If we keep it because a few places are valid, then
Iain Merrick 2012/02/17 23:59:33 Removed in latest patch.
file_ = file_util::OpenFile(path, "w+");
if (IsValid()) {
trace_buffer_.SetOutputCallback(base::Bind(&TraceSubscriberStdio::Write,
« no previous file with comments | « no previous file | content/browser/trace_subscriber_stdio_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698