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

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

Issue 299783004: Create PluginMetricsProvider class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/metrics/metrics_log.h ('k') | chrome/browser/metrics/metrics_log_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/metrics_log.h" 5 #include "chrome/browser/metrics/metrics_log.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/base64.h" 11 #include "base/base64.h"
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "base/cpu.h" 14 #include "base/cpu.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/prefs/pref_registry_simple.h" 16 #include "base/prefs/pref_registry_simple.h"
17 #include "base/prefs/pref_service.h" 17 #include "base/prefs/pref_service.h"
18 #include "base/profiler/alternate_timer.h" 18 #include "base/profiler/alternate_timer.h"
19 #include "base/sha1.h" 19 #include "base/sha1.h"
20 #include "base/strings/string_number_conversions.h" 20 #include "base/strings/string_number_conversions.h"
21 #include "base/strings/string_util.h" 21 #include "base/strings/string_util.h"
22 #include "base/strings/utf_string_conversions.h" 22 #include "base/strings/utf_string_conversions.h"
23 #include "base/sys_info.h" 23 #include "base/sys_info.h"
24 #include "base/third_party/nspr/prtime.h" 24 #include "base/third_party/nspr/prtime.h"
25 #include "base/time/time.h" 25 #include "base/time/time.h"
26 #include "base/tracked_objects.h" 26 #include "base/tracked_objects.h"
27 #include "chrome/browser/browser_process.h" 27 #include "chrome/browser/browser_process.h"
28 #include "chrome/browser/metrics/extension_metrics.h" 28 #include "chrome/browser/metrics/extension_metrics.h"
29 #include "chrome/browser/plugins/plugin_prefs.h"
30 #include "chrome/browser/profiles/profile_manager.h"
31 #include "chrome/common/pref_names.h" 29 #include "chrome/common/pref_names.h"
32 #include "components/metrics/metrics_provider.h" 30 #include "components/metrics/metrics_provider.h"
33 #include "components/metrics/metrics_service_client.h" 31 #include "components/metrics/metrics_service_client.h"
34 #include "components/metrics/proto/profiler_event.pb.h" 32 #include "components/metrics/proto/profiler_event.pb.h"
35 #include "components/metrics/proto/system_profile.pb.h" 33 #include "components/metrics/proto/system_profile.pb.h"
36 #include "components/nacl/common/nacl_process_type.h" 34 #include "components/nacl/common/nacl_process_type.h"
37 #include "components/variations/active_field_trials.h" 35 #include "components/variations/active_field_trials.h"
38 #include "content/public/browser/gpu_data_manager.h" 36 #include "content/public/browser/gpu_data_manager.h"
39 #include "content/public/common/content_client.h" 37 #include "content/public/common/content_client.h"
40 #include "content/public/common/webplugininfo.h"
41 #include "gpu/config/gpu_info.h" 38 #include "gpu/config/gpu_info.h"
42 #include "ui/gfx/screen.h" 39 #include "ui/gfx/screen.h"
43 #include "url/gurl.h" 40 #include "url/gurl.h"
44 41
45 #if defined(OS_ANDROID) 42 #if defined(OS_ANDROID)
46 #include "base/android/build_info.h" 43 #include "base/android/build_info.h"
47 #endif 44 #endif
48 45
49 #if defined(OS_WIN) 46 #if defined(OS_WIN)
50 #include "base/win/metro.h" 47 #include "base/win/metro.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 return ProfilerEventProto::TrackedObject::UNKNOWN; 106 return ProfilerEventProto::TrackedObject::UNKNOWN;
110 } 107 }
111 } 108 }
112 109
113 // Computes a SHA-1 hash of |data| and returns it as a hex string. 110 // Computes a SHA-1 hash of |data| and returns it as a hex string.
114 std::string ComputeSHA1(const std::string& data) { 111 std::string ComputeSHA1(const std::string& data) {
115 const std::string sha1 = base::SHA1HashString(data); 112 const std::string sha1 = base::SHA1HashString(data);
116 return base::HexEncode(sha1.data(), sha1.size()); 113 return base::HexEncode(sha1.data(), sha1.size());
117 } 114 }
118 115
119 #if defined(ENABLE_PLUGINS)
120 // Returns the plugin preferences corresponding for this user, if available.
121 // If multiple user profiles are loaded, returns the preferences corresponding
122 // to an arbitrary one of the profiles.
123 PluginPrefs* GetPluginPrefs() {
124 ProfileManager* profile_manager = g_browser_process->profile_manager();
125
126 if (!profile_manager) {
127 // The profile manager can be NULL when testing.
128 return NULL;
129 }
130
131 std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles();
132 if (profiles.empty())
133 return NULL;
134
135 return PluginPrefs::GetForProfile(profiles.front()).get();
136 }
137
138 // Fills |plugin| with the info contained in |plugin_info| and |plugin_prefs|.
139 void SetPluginInfo(const content::WebPluginInfo& plugin_info,
140 const PluginPrefs* plugin_prefs,
141 SystemProfileProto::Plugin* plugin) {
142 plugin->set_name(base::UTF16ToUTF8(plugin_info.name));
143 plugin->set_filename(plugin_info.path.BaseName().AsUTF8Unsafe());
144 plugin->set_version(base::UTF16ToUTF8(plugin_info.version));
145 plugin->set_is_pepper(plugin_info.is_pepper_plugin());
146 if (plugin_prefs)
147 plugin->set_is_disabled(!plugin_prefs->IsPluginEnabled(plugin_info));
148 }
149 #endif // defined(ENABLE_PLUGINS)
150
151 void WriteFieldTrials(const std::vector<ActiveGroupId>& field_trial_ids, 116 void WriteFieldTrials(const std::vector<ActiveGroupId>& field_trial_ids,
152 SystemProfileProto* system_profile) { 117 SystemProfileProto* system_profile) {
153 for (std::vector<ActiveGroupId>::const_iterator it = 118 for (std::vector<ActiveGroupId>::const_iterator it =
154 field_trial_ids.begin(); it != field_trial_ids.end(); ++it) { 119 field_trial_ids.begin(); it != field_trial_ids.end(); ++it) {
155 SystemProfileProto::FieldTrial* field_trial = 120 SystemProfileProto::FieldTrial* field_trial =
156 system_profile->add_field_trial(); 121 system_profile->add_field_trial();
157 field_trial->set_name_id(it->name); 122 field_trial->set_name_id(it->name);
158 field_trial->set_group_id(it->group); 123 field_trial->set_group_id(it->group);
159 } 124 }
160 } 125 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 extension_metrics_(uma_proto()->client_id()) { 238 extension_metrics_(uma_proto()->client_id()) {
274 uma_proto()->mutable_system_profile()->set_channel(client_->GetChannel()); 239 uma_proto()->mutable_system_profile()->set_channel(client_->GetChannel());
275 240
276 #if defined(OS_CHROMEOS) 241 #if defined(OS_CHROMEOS)
277 metrics_log_chromeos_.reset(new MetricsLogChromeOS(uma_proto())); 242 metrics_log_chromeos_.reset(new MetricsLogChromeOS(uma_proto()));
278 #endif // OS_CHROMEOS 243 #endif // OS_CHROMEOS
279 } 244 }
280 245
281 MetricsLog::~MetricsLog() {} 246 MetricsLog::~MetricsLog() {}
282 247
283 // static
284 void MetricsLog::RegisterPrefs(PrefRegistrySimple* registry) {
285 registry->RegisterListPref(prefs::kStabilityPluginStats);
286 }
287
288 void MetricsLog::RecordStabilityMetrics( 248 void MetricsLog::RecordStabilityMetrics(
289 const std::vector<metrics::MetricsProvider*>& metrics_providers, 249 const std::vector<metrics::MetricsProvider*>& metrics_providers,
290 base::TimeDelta incremental_uptime, 250 base::TimeDelta incremental_uptime,
291 base::TimeDelta uptime) { 251 base::TimeDelta uptime) {
292 DCHECK(!locked()); 252 DCHECK(!locked());
293 DCHECK(HasEnvironment()); 253 DCHECK(HasEnvironment());
294 DCHECK(!HasStabilityMetrics()); 254 DCHECK(!HasStabilityMetrics());
295 255
296 PrefService* pref = GetPrefService(); 256 PrefService* pref = GetPrefService();
297 DCHECK(pref); 257 DCHECK(pref);
298 258
299 // Get stability attributes out of Local State, zeroing out stored values. 259 // Get stability attributes out of Local State, zeroing out stored values.
300 // NOTE: This could lead to some data loss if this report isn't successfully 260 // NOTE: This could lead to some data loss if this report isn't successfully
301 // sent, but that's true for all the metrics. 261 // sent, but that's true for all the metrics.
302 262
303 WriteRequiredStabilityAttributes(pref); 263 WriteRequiredStabilityAttributes(pref);
304 WritePluginStabilityElements(pref);
305 264
306 // Record recent delta for critical stability metrics. We can't wait for a 265 // Record recent delta for critical stability metrics. We can't wait for a
307 // restart to gather these, as that delay biases our observation away from 266 // restart to gather these, as that delay biases our observation away from
308 // users that run happily for a looooong time. We send increments with each 267 // users that run happily for a looooong time. We send increments with each
309 // uma log upload, just as we send histogram data. 268 // uma log upload, just as we send histogram data.
310 WriteRealtimeStabilityAttributes(pref, incremental_uptime, uptime); 269 WriteRealtimeStabilityAttributes(pref, incremental_uptime, uptime);
311 270
312 SystemProfileProto::Stability* stability = 271 SystemProfileProto* system_profile = uma_proto()->mutable_system_profile();
313 uma_proto()->mutable_system_profile()->mutable_stability();
314 for (size_t i = 0; i < metrics_providers.size(); ++i) 272 for (size_t i = 0; i < metrics_providers.size(); ++i)
315 metrics_providers[i]->ProvideStabilityMetrics(stability); 273 metrics_providers[i]->ProvideStabilityMetrics(system_profile);
316 274
317 // Omit some stats unless this is the initial stability log. 275 // Omit some stats unless this is the initial stability log.
318 if (log_type() != INITIAL_STABILITY_LOG) 276 if (log_type() != INITIAL_STABILITY_LOG)
319 return; 277 return;
320 278
321 int incomplete_shutdown_count = 279 int incomplete_shutdown_count =
322 pref->GetInteger(prefs::kStabilityIncompleteSessionEndCount); 280 pref->GetInteger(prefs::kStabilityIncompleteSessionEndCount);
323 pref->SetInteger(prefs::kStabilityIncompleteSessionEndCount, 0); 281 pref->SetInteger(prefs::kStabilityIncompleteSessionEndCount, 0);
324 int breakpad_registration_success_count = 282 int breakpad_registration_success_count =
325 pref->GetInteger(prefs::kStabilityBreakpadRegistrationSuccess); 283 pref->GetInteger(prefs::kStabilityBreakpadRegistrationSuccess);
326 pref->SetInteger(prefs::kStabilityBreakpadRegistrationSuccess, 0); 284 pref->SetInteger(prefs::kStabilityBreakpadRegistrationSuccess, 0);
327 int breakpad_registration_failure_count = 285 int breakpad_registration_failure_count =
328 pref->GetInteger(prefs::kStabilityBreakpadRegistrationFail); 286 pref->GetInteger(prefs::kStabilityBreakpadRegistrationFail);
329 pref->SetInteger(prefs::kStabilityBreakpadRegistrationFail, 0); 287 pref->SetInteger(prefs::kStabilityBreakpadRegistrationFail, 0);
330 int debugger_present_count = 288 int debugger_present_count =
331 pref->GetInteger(prefs::kStabilityDebuggerPresent); 289 pref->GetInteger(prefs::kStabilityDebuggerPresent);
332 pref->SetInteger(prefs::kStabilityDebuggerPresent, 0); 290 pref->SetInteger(prefs::kStabilityDebuggerPresent, 0);
333 int debugger_not_present_count = 291 int debugger_not_present_count =
334 pref->GetInteger(prefs::kStabilityDebuggerNotPresent); 292 pref->GetInteger(prefs::kStabilityDebuggerNotPresent);
335 pref->SetInteger(prefs::kStabilityDebuggerNotPresent, 0); 293 pref->SetInteger(prefs::kStabilityDebuggerNotPresent, 0);
336 294
337 // TODO(jar): The following are all optional, so we *could* optimize them for 295 // TODO(jar): The following are all optional, so we *could* optimize them for
338 // values of zero (and not include them). 296 // values of zero (and not include them).
297 SystemProfileProto::Stability* stability =
298 system_profile->mutable_stability();
339 stability->set_incomplete_shutdown_count(incomplete_shutdown_count); 299 stability->set_incomplete_shutdown_count(incomplete_shutdown_count);
340 stability->set_breakpad_registration_success_count( 300 stability->set_breakpad_registration_success_count(
341 breakpad_registration_success_count); 301 breakpad_registration_success_count);
342 stability->set_breakpad_registration_failure_count( 302 stability->set_breakpad_registration_failure_count(
343 breakpad_registration_failure_count); 303 breakpad_registration_failure_count);
344 stability->set_debugger_present_count(debugger_present_count); 304 stability->set_debugger_present_count(debugger_present_count);
345 stability->set_debugger_not_present_count(debugger_not_present_count); 305 stability->set_debugger_not_present_count(debugger_not_present_count);
346 } 306 }
347 307
348 void MetricsLog::RecordGeneralMetrics( 308 void MetricsLog::RecordGeneralMetrics(
(...skipping 26 matching lines...) Expand all
375 } 335 }
376 336
377 bool MetricsLog::HasEnvironment() const { 337 bool MetricsLog::HasEnvironment() const {
378 return uma_proto()->system_profile().has_uma_enabled_date(); 338 return uma_proto()->system_profile().has_uma_enabled_date();
379 } 339 }
380 340
381 bool MetricsLog::HasStabilityMetrics() const { 341 bool MetricsLog::HasStabilityMetrics() const {
382 return uma_proto()->system_profile().stability().has_launch_count(); 342 return uma_proto()->system_profile().stability().has_launch_count();
383 } 343 }
384 344
385 void MetricsLog::WritePluginStabilityElements(PrefService* pref) {
386 // Now log plugin stability info.
387 const base::ListValue* plugin_stats_list = pref->GetList(
388 prefs::kStabilityPluginStats);
389 if (!plugin_stats_list)
390 return;
391
392 #if defined(ENABLE_PLUGINS)
393 SystemProfileProto::Stability* stability =
394 uma_proto()->mutable_system_profile()->mutable_stability();
395 for (base::ListValue::const_iterator iter = plugin_stats_list->begin();
396 iter != plugin_stats_list->end(); ++iter) {
397 if (!(*iter)->IsType(base::Value::TYPE_DICTIONARY)) {
398 NOTREACHED();
399 continue;
400 }
401 base::DictionaryValue* plugin_dict =
402 static_cast<base::DictionaryValue*>(*iter);
403
404 // Note that this search is potentially a quadratic operation, but given the
405 // low number of plugins installed on a "reasonable" setup, this should be
406 // fine.
407 // TODO(isherman): Verify that this does not show up as a hotspot in
408 // profiler runs.
409 const SystemProfileProto::Plugin* system_profile_plugin = NULL;
410 std::string plugin_name;
411 plugin_dict->GetString(prefs::kStabilityPluginName, &plugin_name);
412 const SystemProfileProto& system_profile = uma_proto()->system_profile();
413 for (int i = 0; i < system_profile.plugin_size(); ++i) {
414 if (system_profile.plugin(i).name() == plugin_name) {
415 system_profile_plugin = &system_profile.plugin(i);
416 break;
417 }
418 }
419
420 if (!system_profile_plugin) {
421 NOTREACHED();
422 continue;
423 }
424
425 SystemProfileProto::Stability::PluginStability* plugin_stability =
426 stability->add_plugin_stability();
427 *plugin_stability->mutable_plugin() = *system_profile_plugin;
428
429 int launches = 0;
430 plugin_dict->GetInteger(prefs::kStabilityPluginLaunches, &launches);
431 if (launches > 0)
432 plugin_stability->set_launch_count(launches);
433
434 int instances = 0;
435 plugin_dict->GetInteger(prefs::kStabilityPluginInstances, &instances);
436 if (instances > 0)
437 plugin_stability->set_instance_count(instances);
438
439 int crashes = 0;
440 plugin_dict->GetInteger(prefs::kStabilityPluginCrashes, &crashes);
441 if (crashes > 0)
442 plugin_stability->set_crash_count(crashes);
443
444 int loading_errors = 0;
445 plugin_dict->GetInteger(prefs::kStabilityPluginLoadingErrors,
446 &loading_errors);
447 if (loading_errors > 0)
448 plugin_stability->set_loading_error_count(loading_errors);
449 }
450 #endif // defined(ENABLE_PLUGINS)
451
452 pref->ClearPref(prefs::kStabilityPluginStats);
453 }
454
455 // The server refuses data that doesn't have certain values. crashcount and 345 // The server refuses data that doesn't have certain values. crashcount and
456 // launchcount are currently "required" in the "stability" group. 346 // launchcount are currently "required" in the "stability" group.
457 // TODO(isherman): Stop writing these attributes specially once the migration to 347 // TODO(isherman): Stop writing these attributes specially once the migration to
458 // protobufs is complete. 348 // protobufs is complete.
459 void MetricsLog::WriteRequiredStabilityAttributes(PrefService* pref) { 349 void MetricsLog::WriteRequiredStabilityAttributes(PrefService* pref) {
460 int launch_count = pref->GetInteger(prefs::kStabilityLaunchCount); 350 int launch_count = pref->GetInteger(prefs::kStabilityLaunchCount);
461 pref->SetInteger(prefs::kStabilityLaunchCount, 0); 351 pref->SetInteger(prefs::kStabilityLaunchCount, 0);
462 int crash_count = pref->GetInteger(prefs::kStabilityCrashCount); 352 int crash_count = pref->GetInteger(prefs::kStabilityCrashCount);
463 pref->SetInteger(prefs::kStabilityCrashCount, 0); 353 pref->SetInteger(prefs::kStabilityCrashCount, 0);
464 354
(...skipping 25 matching lines...) Expand all
490 #endif // OS_CHROMEOS 380 #endif // OS_CHROMEOS
491 381
492 const uint64 incremental_uptime_sec = incremental_uptime.InSeconds(); 382 const uint64 incremental_uptime_sec = incremental_uptime.InSeconds();
493 if (incremental_uptime_sec) 383 if (incremental_uptime_sec)
494 stability->set_incremental_uptime_sec(incremental_uptime_sec); 384 stability->set_incremental_uptime_sec(incremental_uptime_sec);
495 const uint64 uptime_sec = uptime.InSeconds(); 385 const uint64 uptime_sec = uptime.InSeconds();
496 if (uptime_sec) 386 if (uptime_sec)
497 stability->set_uptime_sec(uptime_sec); 387 stability->set_uptime_sec(uptime_sec);
498 } 388 }
499 389
500 void MetricsLog::WritePluginList(
501 const std::vector<content::WebPluginInfo>& plugin_list) {
502 DCHECK(!locked());
503
504 #if defined(ENABLE_PLUGINS)
505 PluginPrefs* plugin_prefs = GetPluginPrefs();
506 SystemProfileProto* system_profile = uma_proto()->mutable_system_profile();
507 for (std::vector<content::WebPluginInfo>::const_iterator iter =
508 plugin_list.begin();
509 iter != plugin_list.end(); ++iter) {
510 SystemProfileProto::Plugin* plugin = system_profile->add_plugin();
511 SetPluginInfo(*iter, plugin_prefs, plugin);
512 }
513 #endif // defined(ENABLE_PLUGINS)
514 }
515
516 void MetricsLog::RecordEnvironment( 390 void MetricsLog::RecordEnvironment(
517 const std::vector<metrics::MetricsProvider*>& metrics_providers, 391 const std::vector<metrics::MetricsProvider*>& metrics_providers,
518 const std::vector<content::WebPluginInfo>& plugin_list,
519 const std::vector<variations::ActiveGroupId>& synthetic_trials) { 392 const std::vector<variations::ActiveGroupId>& synthetic_trials) {
520 DCHECK(!HasEnvironment()); 393 DCHECK(!HasEnvironment());
521 394
522 SystemProfileProto* system_profile = uma_proto()->mutable_system_profile(); 395 SystemProfileProto* system_profile = uma_proto()->mutable_system_profile();
523 396
524 std::string brand_code; 397 std::string brand_code;
525 if (client_->GetBrand(&brand_code)) 398 if (client_->GetBrand(&brand_code))
526 system_profile->set_brand_code(brand_code); 399 system_profile->set_brand_code(brand_code);
527 400
528 int enabled_date; 401 int enabled_date;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 const gfx::Size display_size = GetScreenSize(); 461 const gfx::Size display_size = GetScreenSize();
589 hardware->set_primary_screen_width(display_size.width()); 462 hardware->set_primary_screen_width(display_size.width());
590 hardware->set_primary_screen_height(display_size.height()); 463 hardware->set_primary_screen_height(display_size.height());
591 hardware->set_primary_screen_scale_factor(GetScreenDeviceScaleFactor()); 464 hardware->set_primary_screen_scale_factor(GetScreenDeviceScaleFactor());
592 hardware->set_screen_count(GetScreenCount()); 465 hardware->set_screen_count(GetScreenCount());
593 466
594 #if defined(OS_WIN) 467 #if defined(OS_WIN)
595 WriteScreenDPIInformationProto(hardware); 468 WriteScreenDPIInformationProto(hardware);
596 #endif 469 #endif
597 470
598 WritePluginList(plugin_list);
599 extension_metrics_.WriteExtensionList(uma_proto()->mutable_system_profile()); 471 extension_metrics_.WriteExtensionList(uma_proto()->mutable_system_profile());
600 472
601 std::vector<ActiveGroupId> field_trial_ids; 473 std::vector<ActiveGroupId> field_trial_ids;
602 GetFieldTrialIds(&field_trial_ids); 474 GetFieldTrialIds(&field_trial_ids);
603 WriteFieldTrials(field_trial_ids, system_profile); 475 WriteFieldTrials(field_trial_ids, system_profile);
604 WriteFieldTrials(synthetic_trials, system_profile); 476 WriteFieldTrials(synthetic_trials, system_profile);
605 477
606 #if defined(OS_CHROMEOS) 478 #if defined(OS_CHROMEOS)
607 metrics_log_chromeos_->LogChromeOSMetrics(); 479 metrics_log_chromeos_->LogChromeOSMetrics();
608 #endif // OS_CHROMEOS 480 #endif // OS_CHROMEOS
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 profile = uma_proto()->add_profiler_event(); 530 profile = uma_proto()->add_profiler_event();
659 profile->set_profile_type(ProfilerEventProto::STARTUP_PROFILE); 531 profile->set_profile_type(ProfilerEventProto::STARTUP_PROFILE);
660 profile->set_time_source(ProfilerEventProto::WALL_CLOCK_TIME); 532 profile->set_time_source(ProfilerEventProto::WALL_CLOCK_TIME);
661 } else { 533 } else {
662 // For the remaining calls, re-use the existing field. 534 // For the remaining calls, re-use the existing field.
663 profile = uma_proto()->mutable_profiler_event(0); 535 profile = uma_proto()->mutable_profiler_event(0);
664 } 536 }
665 537
666 WriteProfilerData(process_data, process_type, profile); 538 WriteProfilerData(process_data, process_type, profile);
667 } 539 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_log.h ('k') | chrome/browser/metrics/metrics_log_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698