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

Side by Side Diff: content/browser/browser_shutdown_profile_dumper.cc

Issue 66193005: Independently enable recording and event callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/debug/trace_event_unittest.cc ('k') | content/renderer/devtools/devtools_agent.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/browser_shutdown_profile_dumper.h" 5 #include "content/browser/browser_shutdown_profile_dumper.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/debug/trace_event_impl.h" 10 #include "base/debug/trace_event_impl.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 base::Unretained(this), 58 base::Unretained(this),
59 base::Unretained(&flush_complete_event))); 59 base::Unretained(&flush_complete_event)));
60 60
61 bool original_wait_allowed = base::ThreadRestrictions::SetWaitAllowed(true); 61 bool original_wait_allowed = base::ThreadRestrictions::SetWaitAllowed(true);
62 flush_complete_event.Wait(); 62 flush_complete_event.Wait();
63 base::ThreadRestrictions::SetWaitAllowed(original_wait_allowed); 63 base::ThreadRestrictions::SetWaitAllowed(original_wait_allowed);
64 } 64 }
65 65
66 void BrowserShutdownProfileDumper::EndTraceAndFlush( 66 void BrowserShutdownProfileDumper::EndTraceAndFlush(
67 base::WaitableEvent* flush_complete_event) { 67 base::WaitableEvent* flush_complete_event) {
68 while (base::debug::TraceLog::GetInstance()->IsEnabled()) 68 base::debug::TraceLog::GetInstance()->SetDisabled();
69 base::debug::TraceLog::GetInstance()->SetDisabled();
70 base::debug::TraceLog::GetInstance()->Flush( 69 base::debug::TraceLog::GetInstance()->Flush(
71 base::Bind(&BrowserShutdownProfileDumper::WriteTraceDataCollected, 70 base::Bind(&BrowserShutdownProfileDumper::WriteTraceDataCollected,
72 base::Unretained(this), 71 base::Unretained(this),
73 base::Unretained(flush_complete_event))); 72 base::Unretained(flush_complete_event)));
74 } 73 }
75 74
76 base::FilePath BrowserShutdownProfileDumper::GetFileName() { 75 base::FilePath BrowserShutdownProfileDumper::GetFileName() {
77 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 76 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
78 base::FilePath trace_file = 77 base::FilePath trace_file =
79 command_line.GetSwitchValuePath(switches::kTraceShutdownFile); 78 command_line.GetSwitchValuePath(switches::kTraceShutdownFile);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 } 129 }
131 130
132 void BrowserShutdownProfileDumper::CloseFile() { 131 void BrowserShutdownProfileDumper::CloseFile() {
133 if (!dump_file_) 132 if (!dump_file_)
134 return; 133 return;
135 file_util::CloseFile(dump_file_); 134 file_util::CloseFile(dump_file_);
136 dump_file_ = NULL; 135 dump_file_ = NULL;
137 } 136 }
138 137
139 } // namespace content 138 } // namespace content
OLDNEW
« no previous file with comments | « base/debug/trace_event_unittest.cc ('k') | content/renderer/devtools/devtools_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698