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

Side by Side Diff: chrome/browser/metrics/plugin_metrics_provider.cc

Issue 314583002: Revert of Reduce plugin_metrics_provider_ usage in MetricsService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 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 "chrome/browser/metrics/plugin_metrics_provider.h" 5 #include "chrome/browser/metrics/plugin_metrics_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 int loading_errors = 0; 184 int loading_errors = 0;
185 plugin_dict->GetInteger(prefs::kStabilityPluginLoadingErrors, 185 plugin_dict->GetInteger(prefs::kStabilityPluginLoadingErrors,
186 &loading_errors); 186 &loading_errors);
187 if (loading_errors > 0) 187 if (loading_errors > 0)
188 plugin_stability->set_loading_error_count(loading_errors); 188 plugin_stability->set_loading_error_count(loading_errors);
189 } 189 }
190 190
191 local_state_->ClearPref(prefs::kStabilityPluginStats); 191 local_state_->ClearPref(prefs::kStabilityPluginStats);
192 } 192 }
193 193
194 // Saves plugin-related updates from the in-object buffer to Local State 194 void PluginMetricsProvider::RecordPluginChanges() {
195 // for retrieval next time we send a Profile log (generally next launch).
196 void PluginMetricsProvider::RecordCurrentState() {
197 ListPrefUpdate update(local_state_, prefs::kStabilityPluginStats); 195 ListPrefUpdate update(local_state_, prefs::kStabilityPluginStats);
198 base::ListValue* plugins = update.Get(); 196 base::ListValue* plugins = update.Get();
199 DCHECK(plugins); 197 DCHECK(plugins);
200 198
201 for (base::ListValue::iterator value_iter = plugins->begin(); 199 for (base::ListValue::iterator value_iter = plugins->begin();
202 value_iter != plugins->end(); ++value_iter) { 200 value_iter != plugins->end(); ++value_iter) {
203 if (!(*value_iter)->IsType(base::Value::TYPE_DICTIONARY)) { 201 if (!(*value_iter)->IsType(base::Value::TYPE_DICTIONARY)) {
204 NOTREACHED(); 202 NOTREACHED();
205 continue; 203 continue;
206 } 204 }
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 341
344 void PluginMetricsProvider::BrowserChildProcessCrashed( 342 void PluginMetricsProvider::BrowserChildProcessCrashed(
345 const content::ChildProcessData& data) { 343 const content::ChildProcessData& data) {
346 GetChildProcessStats(data).process_crashes++; 344 GetChildProcessStats(data).process_crashes++;
347 } 345 }
348 346
349 void PluginMetricsProvider::BrowserChildProcessInstanceCreated( 347 void PluginMetricsProvider::BrowserChildProcessInstanceCreated(
350 const content::ChildProcessData& data) { 348 const content::ChildProcessData& data) {
351 GetChildProcessStats(data).instances++; 349 GetChildProcessStats(data).instances++;
352 } 350 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/plugin_metrics_provider.h ('k') | chrome/browser/plugins/plugin_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698