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

Unified Diff: content/shell/shell_main_delegate.cc

Issue 10825080: Add support for Sawbuck to Content Shell (ETW tracing). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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: content/shell/shell_main_delegate.cc
diff --git a/content/shell/shell_main_delegate.cc b/content/shell/shell_main_delegate.cc
index 5d578d5f4969e2f93dcaccbf7fedd54211e2c4c3..114e726284e74baa036998c17fd91760aa61bba3 100644
--- a/content/shell/shell_main_delegate.cc
+++ b/content/shell/shell_main_delegate.cc
@@ -27,8 +27,30 @@
#include "content/shell/paths_mac.h"
#endif // OS_MACOSX
+#if defined(OS_WIN)
+#include "base/logging_win.h"
+#include <initguid.h>
+#endif
+
namespace {
+#if defined(OS_WIN)
+// If "Content Shell" doesn't show up in your list of trace providers in
+// Sawbuck, add these registry entries to your machine (NOTE the optional
+// Wow6432Node key for x64 machines):
+// 1. Find: HKLM\SOFTWARE\[Wow6432Node\]Google\Sawbuck\Providers
+// 2. Add a subkey with the name "{6A3E50A4-7E15-4099-8413-EC94D8C2A4B6}"
+// 3. Add these values:
+// "default_flags"=dword:00000001
+// "default_level"=dword:00000004
+// @="Content Shell"
+
+// {6A3E50A4-7E15-4099-8413-EC94D8C2A4B6}
+const GUID kContentShellProviderName = {
+ 0x6a3e50a4, 0x7e15, 0x4099,
+ { 0x84, 0x13, 0xec, 0x94, 0xd8, 0xc2, 0xa4, 0xb6 } };
+#endif
+
void InitLogging() {
FilePath log_filename;
PathService::Get(base::DIR_EXE, &log_filename);
@@ -56,6 +78,11 @@ ShellMainDelegate::~ShellMainDelegate() {
}
bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
+#if defined(OS_WIN)
+ // Enable trace control and transport through event tracing for Windows.
+ logging::LogEventProvider::Initialize(kContentShellProviderName);
+#endif
+
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) {
InitLogging();
CommandLine::ForCurrentProcess()->AppendSwitch(
« 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