Commit 3016c726 authored by manzagop's avatar manzagop Committed by Commit bot

Initialize logging for Chrome watcher process

BUG=715060

Review-Url: https://codereview.chromium.org/2850863002
Cr-Commit-Position: refs/heads/master@{#468316}
parent 2e60202e
......@@ -61,6 +61,7 @@ shared_library("chrome_watcher") {
"//base",
"//base:base_static",
"//build/config/sanitizers:deps",
"//chrome/common",
"//chrome/install_static:secondary_module",
"//chrome_elf",
"//components/browser_watcher",
......
......@@ -36,6 +36,7 @@
#include "base/win/scoped_handle.h"
#include "base/win/win_util.h"
#include "chrome/chrome_watcher/chrome_watcher_main_api.h"
#include "chrome/common/logging_chrome.h"
#include "chrome/install_static/initialize_from_primary_module.h"
#include "components/browser_watcher/endsession_watcher_window_win.h"
#include "components/browser_watcher/exit_code_watcher_win.h"
......@@ -197,7 +198,9 @@ extern "C" int WatcherMain(const base::char16* registry_path,
base::AtExitManager exit_manager;
// Initialize the commandline singleton from the environment.
base::CommandLine::Init(0, nullptr);
const base::CommandLine& cmd_line = *base::CommandLine::ForCurrentProcess();
logging::InitChromeLogging(cmd_line, logging::APPEND_TO_OLD_LOG_FILE);
logging::LogEventProvider::Initialize(kChromeWatcherTraceProviderName);
// Arrange to be shut down as late as possible, as we want to outlive
......@@ -208,7 +211,6 @@ extern "C" int WatcherMain(const base::char16* registry_path,
base::EnableTerminationOnHeapCorruption();
base::EnableTerminationOnOutOfMemory();
base::win::RegisterInvalidParamHandler();
const base::CommandLine& cmd_line = *base::CommandLine::ForCurrentProcess();
base::win::SetupCRT(cmd_line);
// Run a UI message loop on the main thread.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment