summaryrefslogtreecommitdiffstats
path: root/content/shell/tools
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-29 04:35:05 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-29 04:35:05 +0000
commit369205f0cafcede52d07782e1024a42f0d387faa (patch)
tree5bacd8ff461d56e74e6e2f9028ea8ea565934a2d /content/shell/tools
parent4e63a3c264a8e6fd54e0dc8a2f75b798a00681c6 (diff)
downloadchromium_src-369205f0cafcede52d07782e1024a42f0d387faa.zip
chromium_src-369205f0cafcede52d07782e1024a42f0d387faa.tar.gz
chromium_src-369205f0cafcede52d07782e1024a42f0d387faa.tar.bz2
Add a content_shell_crash_service target on windows
BUG=247431 R=rsesek@chromium.org Review URL: https://codereview.chromium.org/49853002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231517 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell/tools')
-rw-r--r--content/shell/tools/DEPS4
-rw-r--r--content/shell/tools/content_shell_crash_service.cc42
2 files changed, 46 insertions, 0 deletions
diff --git a/content/shell/tools/DEPS b/content/shell/tools/DEPS
new file mode 100644
index 0000000..7083ae7
--- /dev/null
+++ b/content/shell/tools/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+ "+content/public",
+ "+components/breakpad",
+]
diff --git a/content/shell/tools/content_shell_crash_service.cc b/content/shell/tools/content_shell_crash_service.cc
new file mode 100644
index 0000000..180715c
--- /dev/null
+++ b/content/shell/tools/content_shell_crash_service.cc
@@ -0,0 +1,42 @@
+// Copyright 2013 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.
+
+#include <windows.h>
+#include <stdlib.h>
+#include <tchar.h>
+
+#include "base/at_exit.h"
+#include "base/command_line.h"
+#include "base/files/file_path.h"
+#include "base/logging.h"
+#include "components/breakpad/tools/crash_service.h"
+
+int __stdcall wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd_line,
+ int show_mode) {
+ // Manages the destruction of singletons.
+ base::AtExitManager exit_manager;
+
+ CommandLine::Init(0, NULL);
+
+ // Logging to stderr.
+ logging::LoggingSettings settings;
+ settings.logging_dest = logging::LOG_TO_ALL;
+ logging::InitLogging(settings);
+ // Logging with pid, tid and timestamp.
+ logging::SetLogItems(true, true, true, false);
+
+ VLOG(1) << "session start. cmdline is [" << cmd_line << "]";
+
+ breakpad::CrashService crash_service;
+ if (!crash_service.Initialize(base::FilePath(), base::FilePath()))
+ return 1;
+
+ VLOG(1) << "ready to process crash requests";
+
+ // Enter the message loop.
+ int retv = crash_service.ProcessingLoop();
+ // Time to exit.
+ VLOG(1) << "session end. return code is " << retv;
+ return retv;
+}