Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / shell / tools / content_shell_crash_service.cc
blob70c81410f82a66c9f69c9194cdd5104ac14d4d2f
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
3 // found in the LICENSE file.
5 #include <windows.h>
6 #include <stdlib.h>
7 #include <tchar.h>
9 #include "base/at_exit.h"
10 #include "base/command_line.h"
11 #include "base/files/file_path.h"
12 #include "base/logging.h"
13 #include "components/crash/content/tools/crash_service.h"
15 int __stdcall wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd_line,
16 int show_mode) {
17 // Manages the destruction of singletons.
18 base::AtExitManager exit_manager;
20 base::CommandLine::Init(0, NULL);
22 // Logging to stderr.
23 logging::LoggingSettings settings;
24 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
25 logging::InitLogging(settings);
26 // Logging with pid, tid and timestamp.
27 logging::SetLogItems(true, true, true, false);
29 VLOG(1) << "session start. cmdline is [" << cmd_line << "]";
31 breakpad::CrashService crash_service;
32 if (!crash_service.Initialize(base::FilePath(), base::FilePath()))
33 return 1;
35 VLOG(1) << "ready to process crash requests";
37 // Enter the message loop.
38 int retv = crash_service.ProcessingLoop();
39 // Time to exit.
40 VLOG(1) << "session end. return code is " << retv;
41 return retv;