summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_tab.cc
diff options
context:
space:
mode:
authorgrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-01 17:58:04 +0000
committergrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-01 17:58:04 +0000
commit123a1e7f94723d5c52104efff318cc56d5278869 (patch)
tree081bdab354577e5d197f4c780027d85cba945186 /chrome_frame/chrome_tab.cc
parente41a8af4a5cd39c445ebde30e904ea4452bc722e (diff)
downloadchromium_src-123a1e7f94723d5c52104efff318cc56d5278869.zip
chromium_src-123a1e7f94723d5c52104efff318cc56d5278869.tar.gz
chromium_src-123a1e7f94723d5c52104efff318cc56d5278869.tar.bz2
Generate ETW events in Chrome Frame under the control of the same env var as Chrome.
CHROME_ETW_LOGGING env var now controls whether or not npchrome_frame.dll generates ETW events. This matches the behavior in chrome.exe. I also tweaked the log settings so that the same info is included in npchrome_frame.dll log messages as those in chrome.exe. BUG=none TEST=none Review URL: http://codereview.chromium.org/9487011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124427 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_tab.cc')
-rw-r--r--chrome_frame/chrome_tab.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/chrome_frame/chrome_tab.cc b/chrome_frame/chrome_tab.cc
index 6e0373b..69e72f6 100644
--- a/chrome_frame/chrome_tab.cc
+++ b/chrome_frame/chrome_tab.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -22,10 +22,12 @@
#include "base/string_piece.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
+#include "base/utf_string_conversions.h"
#include "base/win/registry.h"
#include "base/win/windows_version.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/env_vars.h"
#include "chrome/installer/util/google_update_settings.h"
#include "chrome_frame/bho.h"
#include "chrome_frame/chrome_active_document.h"
@@ -833,6 +835,12 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance,
logging::DELETE_OLD_LOG_FILE,
logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
+ // Log the same items as Chrome.
+ logging::SetLogItems(true, // enable_process_id
+ true, // enable_thread_id
+ false, // enable_timestamp
+ true); // enable_tickcount
+
DllRedirector* dll_redirector = DllRedirector::GetInstance();
DCHECK(dll_redirector);
@@ -845,8 +853,11 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance,
<< "Found CF module with no DllGetClassObject export.";
}
- // Enable ETW logging.
- logging::LogEventProvider::Initialize(kChromeFrameProvider);
+ // Enable trace control and transport through event tracing for Windows.
+ if (::GetEnvironmentVariable(ASCIIToWide(env_vars::kEtwLogging).c_str(),
+ NULL, 0)) {
+ logging::LogEventProvider::Initialize(kChromeFrameProvider);
+ }
} else if (reason == DLL_PROCESS_DETACH) {
DllRedirector* dll_redirector = DllRedirector::GetInstance();
DCHECK(dll_redirector);