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

Side by Side Diff: ios/chrome/browser/metrics/ios_chrome_stability_metrics_provider.cc

Issue 2670743002: Track renderer crash detected on WebState via GlobalWebStateObserver (Closed)
Patch Set: comment Created 3 years, 9 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ios/chrome/browser/metrics/ios_chrome_stability_metrics_provider.h"
6
7 IOSChromeStabilityMetricsProvider::IOSChromeStabilityMetricsProvider(
8 PrefService* local_state)
9 : helper_(local_state), recording_enabled_(false) {}
10
11 IOSChromeStabilityMetricsProvider::~IOSChromeStabilityMetricsProvider() {}
12
13 void IOSChromeStabilityMetricsProvider::OnRecordingEnabled() {
14 recording_enabled_ = true;
15 }
16
17 void IOSChromeStabilityMetricsProvider::OnRecordingDisabled() {
18 recording_enabled_ = false;
19 }
20
21 void IOSChromeStabilityMetricsProvider::ProvideStabilityMetrics(
22 metrics::SystemProfileProto* system_profile_proto) {
23 helper_.ProvideStabilityMetrics(system_profile_proto);
24 }
25
26 void IOSChromeStabilityMetricsProvider::ClearSavedStabilityMetrics() {
27 helper_.ClearSavedStabilityMetrics();
28 }
29
30 void IOSChromeStabilityMetricsProvider::LogRendererCrash() {
31 if (!recording_enabled_)
32 return;
33
34 // The actual termination code isn't provided on iOS; use a dummy value.
35 // TODO(blundell): Think about having StabilityMetricsHelper have a variant
36 // that doesn't supply these arguments to make this cleaner.
37 int dummy_termination_code = 105;
38 helper_.LogRendererCrash(false /* not an extension process */,
39 base::TERMINATION_STATUS_ABNORMAL_TERMINATION,
40 dummy_termination_code);
41 }
42
43 void IOSChromeStabilityMetricsProvider::WebStateDidStartLoading(
44 web::WebState* web_state) {
45 if (!recording_enabled_)
46 return;
47
48 helper_.LogLoadStarted();
49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698