Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(669)

Unified Diff: blimp/engine/app/blimp_content_main_delegate.cc

Issue 1925993004: Initial addition of Blimp engine crash client code (take 2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/::crash_keys/crash_keys/ Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: blimp/engine/app/blimp_content_main_delegate.cc
diff --git a/blimp/engine/app/blimp_content_main_delegate.cc b/blimp/engine/app/blimp_content_main_delegate.cc
index aa31459654ea1e93e9cc929792ffa99d5b036b68..c258341db299222dea9d0ddf95a277ab8a643f83 100644
--- a/blimp/engine/app/blimp_content_main_delegate.cc
+++ b/blimp/engine/app/blimp_content_main_delegate.cc
@@ -4,18 +4,32 @@
#include "blimp/engine/app/blimp_content_main_delegate.h"
+#include <string>
+
+#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
+#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "blimp/engine/app/blimp_content_browser_client.h"
+#include "blimp/engine/app/blimp_engine_crash_reporter_client.h"
#include "blimp/engine/renderer/blimp_content_renderer_client.h"
+#include "components/crash/content/app/breakpad_linux.h"
+#include "components/crash/content/app/crash_reporter_client.h"
+#include "content/public/common/content_switches.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "ui/base/resource/resource_bundle.h"
namespace blimp {
namespace engine {
+
+// Blimp engine crash client. This should be available globally and should be
+// long lived.
+base::LazyInstance<BlimpEngineCrashReporterClient>
+ g_blimp_engine_crash_reporter_client = LAZY_INSTANCE_INITIALIZER;
+
namespace {
void InitLogging() {
// TODO(haibinlu): Remove this before release.
@@ -51,6 +65,16 @@ bool BlimpContentMainDelegate::BasicStartupComplete(int* exit_code) {
}
void BlimpContentMainDelegate::PreSandboxStartup() {
+ // Enable crash reporting for all processes, and initialize the crash
+ // reporter client.
+ crash_reporter::SetCrashReporterClient(
+ g_blimp_engine_crash_reporter_client.Pointer());
+ base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
+ const std::string process_type =
Kevin M 2016/05/02 22:05:31 No need to bind a variable, just use the switch ge
marcinjb 2016/05/03 18:06:58 Done.
+ cmd->GetSwitchValueASCII(::switches::kProcessType);
+ cmd->AppendSwitch(::switches::kEnableCrashReporter);
+ breakpad::InitCrashReporter(process_type);
+
InitializeResourceBundle();
}

Powered by Google App Engine
This is Rietveld 408576698