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

Unified Diff: content/browser/gpu/gpu_process_host_ui_shim.cc

Issue 108683003: Store gpu crashes in the systemprofileproto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ALexei comments 2 Created 7 years 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: content/browser/gpu/gpu_process_host_ui_shim.cc
diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc
index b17bc59faae752ffa98445671ceac7261a81bcdb..9d1e80c442c28774a4443058f0e0390b406f3910 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -11,6 +11,7 @@
#include "base/debug/trace_event.h"
#include "base/id_map.h"
#include "base/lazy_instance.h"
+#include "base/process/kill.h"
#include "base/strings/string_number_conversions.h"
#include "content/browser/gpu/gpu_data_manager_impl.h"
#include "content/browser/gpu/gpu_process_host.h"
@@ -20,6 +21,8 @@
#include "content/common/gpu/gpu_messages.h"
#include "content/port/browser/render_widget_host_view_port.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/notification_service.h"
+#include "content/public/browser/notification_types.h"
#include "ui/gl/gl_switches.h"
// From gl2/gl2ext.h.
@@ -106,7 +109,18 @@ GpuProcessHostUIShim* GpuProcessHostUIShim::Create(int host_id) {
}
// static
-void GpuProcessHostUIShim::Destroy(int host_id, const std::string& message) {
+void GpuProcessHostUIShim::Destroy(int host_id,
+ base::TerminationStatus status,
+ const std::string& message) {
+ // Send a notification if the GPU process did not turn down normally. This
+ // is used to signal a gpu crash to the metrics service.
+ if (status != base::TERMINATION_STATUS_NORMAL_TERMINATION) {
+ content::NotificationService::current()->Notify(
piman 2013/12/16 22:12:04 We're moving away from the Notification pattern, a
Ilya Sherman 2013/12/16 23:04:39 +1
+ content::NOTIFICATION_GPU_PROCESS_CLOSED_ABNORMALLY,
+ NotificationService::AllSources(),
+ NotificationService::NoDetails());
+ }
+
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
GpuDataManagerImpl::GetInstance()->AddLogMessage(

Powered by Google App Engine
This is Rietveld 408576698