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

Side by Side Diff: android_webview/browser/aw_browser_terminator.cc

Issue 2833893002: [Android WebView] Trigger minidump uploading on renderer crash. (Closed)
Patch Set: Rebase Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "android_webview/browser/aw_browser_terminator.h" 5 #include "android_webview/browser/aw_browser_terminator.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 8
9 #include "android_webview/browser/aw_browser_process.h"
9 #include "android_webview/browser/aw_render_process_gone_delegate.h" 10 #include "android_webview/browser/aw_render_process_gone_delegate.h"
10 #include "android_webview/common/aw_descriptors.h" 11 #include "android_webview/common/aw_descriptors.h"
11 #include "android_webview/common/crash_reporter/aw_microdump_crash_reporter.h" 12 #include "android_webview/common/crash_reporter/aw_microdump_crash_reporter.h"
12 #include "base/bind.h" 13 #include "base/bind.h"
13 #include "base/logging.h" 14 #include "base/logging.h"
14 #include "base/stl_util.h" 15 #include "base/stl_util.h"
15 #include "base/sync_socket.h" 16 #include "base/sync_socket.h"
16 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
17 #include "content/public/browser/child_process_data.h" 18 #include "content/public/browser/child_process_data.h"
18 #include "content/public/browser/notification_service.h" 19 #include "content/public/browser/notification_service.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // The render process was most likely killed for OOM or switching 79 // The render process was most likely killed for OOM or switching
79 // WebView provider, to make WebView backward compatible, kills the 80 // WebView provider, to make WebView backward compatible, kills the
80 // browser process instead of triggering crash. 81 // browser process instead of triggering crash.
81 LOG(ERROR) << "Render process (" << child_process_pid << ") kill (OOM" 82 LOG(ERROR) << "Render process (" << child_process_pid << ") kill (OOM"
82 << " or update) wasn't handed by all associated webviews," 83 << " or update) wasn't handed by all associated webviews,"
83 << " killing application."; 84 << " killing application.";
84 kill(getpid(), SIGKILL); 85 kill(getpid(), SIGKILL);
85 } 86 }
86 } 87 }
87 } 88 }
89
90 // By this point we have moved the minidump to the crash directory, so it can
91 // now be copied and uploaded. This is guaranteed by the order in which we
92 // register breakpad::CrashDumpManager and AwBrowserTerminator as
93 // breakpad::CrashDumpObserver clients over in AwBrowserMainParts
94 // (CrashDumpManager is registered first).
95 TriggerMinidumpUploading();
88 } 96 }
89 97
90 } // namespace 98 } // namespace
91 99
92 AwBrowserTerminator::AwBrowserTerminator() {} 100 AwBrowserTerminator::AwBrowserTerminator() {}
93 101
94 AwBrowserTerminator::~AwBrowserTerminator() {} 102 AwBrowserTerminator::~AwBrowserTerminator() {}
95 103
96 void AwBrowserTerminator::OnChildStart(int child_process_id, 104 void AwBrowserTerminator::OnChildStart(int child_process_id,
97 content::FileDescriptorInfo* mappings) { 105 content::FileDescriptorInfo* mappings) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 return; 162 return;
155 OnRenderProcessGone(child_process_id); 163 OnRenderProcessGone(child_process_id);
156 DCHECK(pipe->handle() != base::SyncSocket::kInvalidHandle); 164 DCHECK(pipe->handle() != base::SyncSocket::kInvalidHandle);
157 BrowserThread::PostTask( 165 BrowserThread::PostTask(
158 BrowserThread::FILE, FROM_HERE, 166 BrowserThread::FILE, FROM_HERE,
159 base::Bind(&AwBrowserTerminator::ProcessTerminationStatus, 167 base::Bind(&AwBrowserTerminator::ProcessTerminationStatus,
160 child_process_id, pid, base::Passed(std::move(pipe)))); 168 child_process_id, pid, base::Passed(std::move(pipe))));
161 } 169 }
162 170
163 } // namespace breakpad 171 } // namespace breakpad
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698