OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromecast/crash/cast_crash_reporter_client.h" | 5 #include "chromecast/crash/cast_crash_reporter_client.h" |
6 | 6 |
7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "chromecast/base/error_codes.h" | |
9 #include "chromecast/crash/crash_util.h" | |
gunsch
2015/06/10 16:33:30
ordering (how did this get through git cl upload c
slan
2015/06/11 02:34:48
chromecast < components :)
gunsch
2015/06/12 00:37:09
Ha, I can't read. Carry on.
| |
8 #include "components/crash/app/breakpad_linux.h" | 10 #include "components/crash/app/breakpad_linux.h" |
9 #include "content/public/common/content_switches.h" | 11 #include "content/public/common/content_switches.h" |
10 | 12 |
11 namespace chromecast { | 13 namespace chromecast { |
12 | 14 |
13 namespace { | 15 namespace { |
14 | 16 |
15 char* g_process_type = NULL; | 17 char* g_process_type = NULL; |
16 uint64_t g_process_start_time = 0; | 18 uint64_t g_process_start_time = 0; |
17 | 19 |
(...skipping 30 matching lines...) Expand all Loading... | |
48 CastCrashReporterClient::CastCrashReporterClient() {} | 50 CastCrashReporterClient::CastCrashReporterClient() {} |
49 CastCrashReporterClient::~CastCrashReporterClient() {} | 51 CastCrashReporterClient::~CastCrashReporterClient() {} |
50 | 52 |
51 bool CastCrashReporterClient::EnableBreakpadForProcess( | 53 bool CastCrashReporterClient::EnableBreakpadForProcess( |
52 const std::string& process_type) { | 54 const std::string& process_type) { |
53 return process_type == switches::kRendererProcess || | 55 return process_type == switches::kRendererProcess || |
54 process_type == switches::kZygoteProcess || | 56 process_type == switches::kZygoteProcess || |
55 process_type == switches::kGpuProcess; | 57 process_type == switches::kGpuProcess; |
56 } | 58 } |
57 | 59 |
60 bool CastCrashReporterClient::HandleCrashDump(const char* crashdump_filename) { | |
61 // Set the initial error code to ERROR_WEB_CONTENT_RENDER_VIEW_GONE to show | |
62 // an error message on next cast_shell run. Though the error code is for | |
63 // renderer process crash, the actual messages can be used for browser process | |
64 // as well. | |
65 if (!GetProcessType() || !strcmp(GetProcessType(), "browser")) | |
66 SetInitialErrorCode(ERROR_WEB_CONTENT_RENDER_VIEW_GONE); | |
67 | |
68 // Upload crash dump. If user didn't opt-in crash report, minidump writer | |
69 // instantiated within CrashUtil::RequestUploadCrashDump() does nothing. | |
70 CrashUtil::RequestUploadCrashDump( | |
71 crashdump_filename, GetProcessType(), GetProcessStartTime()); | |
72 | |
73 // Always return true to indicate that this crash dump has been processed, | |
74 // so that it won't fallback to use chrome's default uploader. | |
75 return true; | |
76 } | |
77 | |
58 } // namespace chromecast | 78 } // namespace chromecast |
OLD | NEW |