summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--content/content_shell.gypi23
-rw-r--r--content/shell/tools/DEPS4
-rw-r--r--content/shell/tools/content_shell_crash_service.cc42
3 files changed, 69 insertions, 0 deletions
diff --git a/content/content_shell.gypi b/content/content_shell.gypi
index 889fbcb..32687b2 100644
--- a/content/content_shell.gypi
+++ b/content/content_shell.gypi
@@ -889,6 +889,29 @@
},
],
}], # OS=="android"
+ ['OS=="win"', {
+ 'targets': [
+ {
+ 'target_name': 'content_shell_crash_service',
+ 'type': 'executable',
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../components/components.gyp:breakpad_crash_service',
+ ],
+ 'include_dirs': [
+ '..',
+ ],
+ 'sources': [
+ 'shell/tools/content_shell_crash_service.cc',
+ ],
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS
+ },
+ },
+ },
+ ],
+ }], # OS=="win"
['OS=="win" and fastbuild==0 and target_arch=="ia32"', {
'variables': {
'dest_dir': '<(PRODUCT_DIR)/syzygy',
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;
+}