| Index: chrome/chrome_watcher/chrome_watcher_main.cc
|
| diff --git a/chrome/chrome_watcher/chrome_watcher_main.cc b/chrome/chrome_watcher/chrome_watcher_main.cc
|
| index 5b5504b50f7e60b90f1e33fad3f72ce3b6f06b94..51e5e1888784c3e2deda5dbb9e911d828706dd08 100644
|
| --- a/chrome/chrome_watcher/chrome_watcher_main.cc
|
| +++ b/chrome/chrome_watcher/chrome_watcher_main.cc
|
| @@ -8,12 +8,14 @@
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| #include "base/command_line.h"
|
| +#include "base/files/file_path.h"
|
| #include "base/logging_win.h"
|
| #include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/message_loop/message_loop.h"
|
| #include "base/message_loop/message_loop_proxy.h"
|
| #include "base/process/process.h"
|
| +#include "base/process/process_handle.h"
|
| #include "base/run_loop.h"
|
| #include "base/sequenced_task_runner.h"
|
| #include "base/synchronization/waitable_event.h"
|
| @@ -25,6 +27,8 @@
|
| #include "components/browser_watcher/exit_code_watcher_win.h"
|
| #include "components/browser_watcher/exit_funnel_win.h"
|
|
|
| +#include "syzygy/kasko/api/reporter.h"
|
| +
|
| namespace {
|
|
|
| // Use the same log facility as Chrome for convenience.
|
| @@ -185,7 +189,8 @@ void BrowserMonitor::BrowserExited() {
|
| // mangling.
|
| extern "C" int WatcherMain(const base::char16* registry_path,
|
| HANDLE process_handle,
|
| - HANDLE on_initialized_event_handle) {
|
| + HANDLE on_initialized_event_handle,
|
| + const base::char16* browser_data_directory) {
|
| base::Process process(process_handle);
|
| base::win::ScopedHandle on_initialized_event(on_initialized_event_handle);
|
|
|
| @@ -200,6 +205,20 @@ extern "C" int WatcherMain(const base::char16* registry_path,
|
| // chrome.exe in order to report its exit status.
|
| ::SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY);
|
|
|
| +#ifdef SYZYASAN
|
| + bool launched_kasko = kasko::api::InitializeReporter(
|
| + GetKaskoEndpoint(process.pid()).c_str(),
|
| + L"http://clients2.google.com/cr/staging_report",
|
| + base::FilePath(browser_data_directory)
|
| + .Append(L"Crash Reports")
|
| + .value()
|
| + .c_str(),
|
| + base::FilePath(browser_data_directory)
|
| + .Append(L"Crash Reports Fallback")
|
| + .value()
|
| + .c_str());
|
| +#endif // SYZYASAN
|
| +
|
| // Run a UI message loop on the main thread.
|
| base::MessageLoop msg_loop(base::MessageLoop::TYPE_UI);
|
| msg_loop.set_thread_name("WatcherMainThread");
|
| @@ -213,6 +232,11 @@ extern "C" int WatcherMain(const base::char16* registry_path,
|
|
|
| run_loop.Run();
|
|
|
| +#ifdef SYZYASAN
|
| + if (launched_kasko)
|
| + kasko::api::ShutdownReporter();
|
| +#endif // SYZYASAN
|
| +
|
| // Wind logging down.
|
| logging::LogEventProvider::Uninitialize();
|
|
|
|
|