| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 //------------------------------------------------------------------------------ | 5 //------------------------------------------------------------------------------ |
| 6 // Description of the life cycle of a instance of MetricsService. | 6 // Description of the life cycle of a instance of MetricsService. |
| 7 // | 7 // |
| 8 // OVERVIEW | 8 // OVERVIEW |
| 9 // | 9 // |
| 10 // A MetricsService instance is typically created at application startup. It | 10 // A MetricsService instance is typically created at application startup. It |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 #include "chrome/browser/metrics/histogram_synchronizer.h" | 174 #include "chrome/browser/metrics/histogram_synchronizer.h" |
| 175 #include "chrome/browser/metrics/metrics_log.h" | 175 #include "chrome/browser/metrics/metrics_log.h" |
| 176 #include "chrome/browser/metrics/metrics_reporting_scheduler.h" | 176 #include "chrome/browser/metrics/metrics_reporting_scheduler.h" |
| 177 #include "chrome/browser/net/network_stats.h" | 177 #include "chrome/browser/net/network_stats.h" |
| 178 #include "chrome/browser/prefs/pref_service.h" | 178 #include "chrome/browser/prefs/pref_service.h" |
| 179 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 179 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 180 #include "chrome/browser/profiles/profile.h" | 180 #include "chrome/browser/profiles/profile.h" |
| 181 #include "chrome/browser/search_engines/template_url_service.h" | 181 #include "chrome/browser/search_engines/template_url_service.h" |
| 182 #include "chrome/browser/ui/browser_list.h" | 182 #include "chrome/browser/ui/browser_list.h" |
| 183 #include "chrome/common/child_process_logging.h" | 183 #include "chrome/common/child_process_logging.h" |
| 184 #include "chrome/common/chrome_notification_types.h" |
| 184 #include "chrome/common/chrome_switches.h" | 185 #include "chrome/common/chrome_switches.h" |
| 185 #include "chrome/common/guid.h" | 186 #include "chrome/common/guid.h" |
| 186 #include "chrome/common/pref_names.h" | 187 #include "chrome/common/pref_names.h" |
| 187 #include "chrome/common/render_messages.h" | 188 #include "chrome/common/render_messages.h" |
| 188 #include "content/browser/load_notification_details.h" | 189 #include "content/browser/load_notification_details.h" |
| 189 #include "content/browser/renderer_host/render_process_host.h" | 190 #include "content/browser/renderer_host/render_process_host.h" |
| 190 #include "content/common/child_process_info.h" | 191 #include "content/common/child_process_info.h" |
| 191 #include "content/common/notification_service.h" | 192 #include "content/common/notification_service.h" |
| 192 #include "webkit/plugins/npapi/plugin_list.h" | 193 #include "webkit/plugins/npapi/plugin_list.h" |
| 193 #include "webkit/plugins/npapi/webplugininfo.h" | 194 #include "webkit/plugins/npapi/webplugininfo.h" |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 } | 527 } |
| 527 | 528 |
| 528 bool MetricsService::reporting_active() const { | 529 bool MetricsService::reporting_active() const { |
| 529 DCHECK(IsSingleThreaded()); | 530 DCHECK(IsSingleThreaded()); |
| 530 return reporting_active_; | 531 return reporting_active_; |
| 531 } | 532 } |
| 532 | 533 |
| 533 // static | 534 // static |
| 534 void MetricsService::SetUpNotifications(NotificationRegistrar* registrar, | 535 void MetricsService::SetUpNotifications(NotificationRegistrar* registrar, |
| 535 NotificationObserver* observer) { | 536 NotificationObserver* observer) { |
| 536 registrar->Add(observer, NotificationType::BROWSER_OPENED, | 537 registrar->Add(observer, chrome::NOTIFICATION_BROWSER_OPENED, |
| 537 NotificationService::AllSources()); | 538 NotificationService::AllSources()); |
| 538 registrar->Add(observer, NotificationType::BROWSER_CLOSED, | 539 registrar->Add(observer, chrome::NOTIFICATION_BROWSER_CLOSED, |
| 539 NotificationService::AllSources()); | 540 NotificationService::AllSources()); |
| 540 registrar->Add(observer, NotificationType::USER_ACTION, | 541 registrar->Add(observer, content::NOTIFICATION_USER_ACTION, |
| 541 NotificationService::AllSources()); | 542 NotificationService::AllSources()); |
| 542 registrar->Add(observer, NotificationType::TAB_PARENTED, | 543 registrar->Add(observer, content::NOTIFICATION_TAB_PARENTED, |
| 543 NotificationService::AllSources()); | 544 NotificationService::AllSources()); |
| 544 registrar->Add(observer, NotificationType::TAB_CLOSING, | 545 registrar->Add(observer, content::NOTIFICATION_TAB_CLOSING, |
| 545 NotificationService::AllSources()); | 546 NotificationService::AllSources()); |
| 546 registrar->Add(observer, NotificationType::LOAD_START, | 547 registrar->Add(observer, content::NOTIFICATION_LOAD_START, |
| 547 NotificationService::AllSources()); | 548 NotificationService::AllSources()); |
| 548 registrar->Add(observer, NotificationType::LOAD_STOP, | 549 registrar->Add(observer, content::NOTIFICATION_LOAD_STOP, |
| 549 NotificationService::AllSources()); | 550 NotificationService::AllSources()); |
| 550 registrar->Add(observer, NotificationType::RENDERER_PROCESS_CLOSED, | 551 registrar->Add(observer, content::NOTIFICATION_RENDERER_PROCESS_CLOSED, |
| 551 NotificationService::AllSources()); | 552 NotificationService::AllSources()); |
| 552 registrar->Add(observer, NotificationType::RENDERER_PROCESS_HANG, | 553 registrar->Add(observer, content::NOTIFICATION_RENDERER_PROCESS_HANG, |
| 553 NotificationService::AllSources()); | 554 NotificationService::AllSources()); |
| 554 registrar->Add(observer, NotificationType::CHILD_PROCESS_HOST_CONNECTED, | 555 registrar->Add(observer, content::NOTIFICATION_CHILD_PROCESS_HOST_CONNECTED, |
| 555 NotificationService::AllSources()); | 556 NotificationService::AllSources()); |
| 556 registrar->Add(observer, NotificationType::CHILD_INSTANCE_CREATED, | 557 registrar->Add(observer, content::NOTIFICATION_CHILD_INSTANCE_CREATED, |
| 557 NotificationService::AllSources()); | 558 NotificationService::AllSources()); |
| 558 registrar->Add(observer, NotificationType::CHILD_PROCESS_CRASHED, | 559 registrar->Add(observer, content::NOTIFICATION_CHILD_PROCESS_CRASHED, |
| 559 NotificationService::AllSources()); | 560 NotificationService::AllSources()); |
| 560 registrar->Add(observer, NotificationType::TEMPLATE_URL_SERVICE_LOADED, | 561 registrar->Add(observer, chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED, |
| 561 NotificationService::AllSources()); | 562 NotificationService::AllSources()); |
| 562 registrar->Add(observer, NotificationType::OMNIBOX_OPENED_URL, | 563 registrar->Add(observer, chrome::NOTIFICATION_OMNIBOX_OPENED_URL, |
| 563 NotificationService::AllSources()); | 564 NotificationService::AllSources()); |
| 564 registrar->Add(observer, NotificationType::BOOKMARK_MODEL_LOADED, | 565 registrar->Add(observer, chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED, |
| 565 NotificationService::AllSources()); | 566 NotificationService::AllSources()); |
| 566 } | 567 } |
| 567 | 568 |
| 568 void MetricsService::Observe(NotificationType type, | 569 void MetricsService::Observe(int type, |
| 569 const NotificationSource& source, | 570 const NotificationSource& source, |
| 570 const NotificationDetails& details) { | 571 const NotificationDetails& details) { |
| 571 DCHECK(current_log_); | 572 DCHECK(current_log_); |
| 572 DCHECK(IsSingleThreaded()); | 573 DCHECK(IsSingleThreaded()); |
| 573 | 574 |
| 574 if (!CanLogNotification(type, source, details)) | 575 if (!CanLogNotification(type, source, details)) |
| 575 return; | 576 return; |
| 576 | 577 |
| 577 switch (type.value) { | 578 switch (type) { |
| 578 case NotificationType::USER_ACTION: | 579 case content::NOTIFICATION_USER_ACTION: |
| 579 current_log_->RecordUserAction(*Details<const char*>(details).ptr()); | 580 current_log_->RecordUserAction(*Details<const char*>(details).ptr()); |
| 580 break; | 581 break; |
| 581 | 582 |
| 582 case NotificationType::BROWSER_OPENED: | 583 case chrome::NOTIFICATION_BROWSER_OPENED: |
| 583 case NotificationType::BROWSER_CLOSED: | 584 case chrome::NOTIFICATION_BROWSER_CLOSED: |
| 584 LogWindowChange(type, source, details); | 585 LogWindowChange(type, source, details); |
| 585 break; | 586 break; |
| 586 | 587 |
| 587 case NotificationType::TAB_PARENTED: | 588 case content::NOTIFICATION_TAB_PARENTED: |
| 588 case NotificationType::TAB_CLOSING: | 589 case content::NOTIFICATION_TAB_CLOSING: |
| 589 LogWindowChange(type, source, details); | 590 LogWindowChange(type, source, details); |
| 590 break; | 591 break; |
| 591 | 592 |
| 592 case NotificationType::LOAD_STOP: | 593 case content::NOTIFICATION_LOAD_STOP: |
| 593 LogLoadComplete(type, source, details); | 594 LogLoadComplete(type, source, details); |
| 594 break; | 595 break; |
| 595 | 596 |
| 596 case NotificationType::LOAD_START: | 597 case content::NOTIFICATION_LOAD_START: |
| 597 LogLoadStarted(); | 598 LogLoadStarted(); |
| 598 break; | 599 break; |
| 599 | 600 |
| 600 case NotificationType::RENDERER_PROCESS_CLOSED: { | 601 case content::NOTIFICATION_RENDERER_PROCESS_CLOSED: { |
| 601 RenderProcessHost::RendererClosedDetails* process_details = | 602 RenderProcessHost::RendererClosedDetails* process_details = |
| 602 Details<RenderProcessHost::RendererClosedDetails>(details).ptr(); | 603 Details<RenderProcessHost::RendererClosedDetails>(details).ptr(); |
| 603 if (process_details->status == | 604 if (process_details->status == |
| 604 base::TERMINATION_STATUS_PROCESS_CRASHED || | 605 base::TERMINATION_STATUS_PROCESS_CRASHED || |
| 605 process_details->status == | 606 process_details->status == |
| 606 base::TERMINATION_STATUS_ABNORMAL_TERMINATION) { | 607 base::TERMINATION_STATUS_ABNORMAL_TERMINATION) { |
| 607 if (process_details->was_extension_renderer) { | 608 if (process_details->was_extension_renderer) { |
| 608 LogExtensionRendererCrash(); | 609 LogExtensionRendererCrash(); |
| 609 } else { | 610 } else { |
| 610 LogRendererCrash(); | 611 LogRendererCrash(); |
| 611 } | 612 } |
| 612 } | 613 } |
| 613 } | 614 } |
| 614 break; | 615 break; |
| 615 | 616 |
| 616 case NotificationType::RENDERER_PROCESS_HANG: | 617 case content::NOTIFICATION_RENDERER_PROCESS_HANG: |
| 617 LogRendererHang(); | 618 LogRendererHang(); |
| 618 break; | 619 break; |
| 619 | 620 |
| 620 case NotificationType::CHILD_PROCESS_HOST_CONNECTED: | 621 case content::NOTIFICATION_CHILD_PROCESS_HOST_CONNECTED: |
| 621 case NotificationType::CHILD_PROCESS_CRASHED: | 622 case content::NOTIFICATION_CHILD_PROCESS_CRASHED: |
| 622 case NotificationType::CHILD_INSTANCE_CREATED: | 623 case content::NOTIFICATION_CHILD_INSTANCE_CREATED: |
| 623 LogChildProcessChange(type, source, details); | 624 LogChildProcessChange(type, source, details); |
| 624 break; | 625 break; |
| 625 | 626 |
| 626 case NotificationType::TEMPLATE_URL_SERVICE_LOADED: | 627 case chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED: |
| 627 LogKeywords(Source<TemplateURLService>(source).ptr()); | 628 LogKeywords(Source<TemplateURLService>(source).ptr()); |
| 628 break; | 629 break; |
| 629 | 630 |
| 630 case NotificationType::OMNIBOX_OPENED_URL: { | 631 case chrome::NOTIFICATION_OMNIBOX_OPENED_URL: { |
| 631 MetricsLog* current_log = current_log_->AsMetricsLog(); | 632 MetricsLog* current_log = current_log_->AsMetricsLog(); |
| 632 DCHECK(current_log); | 633 DCHECK(current_log); |
| 633 current_log->RecordOmniboxOpenedURL( | 634 current_log->RecordOmniboxOpenedURL( |
| 634 *Details<AutocompleteLog>(details).ptr()); | 635 *Details<AutocompleteLog>(details).ptr()); |
| 635 break; | 636 break; |
| 636 } | 637 } |
| 637 | 638 |
| 638 case NotificationType::BOOKMARK_MODEL_LOADED: { | 639 case chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED: { |
| 639 Profile* p = Source<Profile>(source).ptr(); | 640 Profile* p = Source<Profile>(source).ptr(); |
| 640 if (p) | 641 if (p) |
| 641 LogBookmarks(p->GetBookmarkModel()); | 642 LogBookmarks(p->GetBookmarkModel()); |
| 642 break; | 643 break; |
| 643 } | 644 } |
| 644 default: | 645 default: |
| 645 NOTREACHED(); | 646 NOTREACHED(); |
| 646 break; | 647 break; |
| 647 } | 648 } |
| 648 | 649 |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1377 VLOG(1) << "Verify your metrics logs are formatted correctly. Verify server " | 1378 VLOG(1) << "Verify your metrics logs are formatted correctly. Verify server " |
| 1378 "is active at " << server_url_; | 1379 "is active at " << server_url_; |
| 1379 if (!pending_log()) { | 1380 if (!pending_log()) { |
| 1380 VLOG(1) << "METRICS: Recorder shutdown during log transmission."; | 1381 VLOG(1) << "METRICS: Recorder shutdown during log transmission."; |
| 1381 } else { | 1382 } else { |
| 1382 VLOG(1) << "METRICS: transmission retry being scheduled for " | 1383 VLOG(1) << "METRICS: transmission retry being scheduled for " |
| 1383 << compressed_log_; | 1384 << compressed_log_; |
| 1384 } | 1385 } |
| 1385 } | 1386 } |
| 1386 | 1387 |
| 1387 void MetricsService::LogWindowChange(NotificationType type, | 1388 void MetricsService::LogWindowChange(int type, |
| 1388 const NotificationSource& source, | 1389 const NotificationSource& source, |
| 1389 const NotificationDetails& details) { | 1390 const NotificationDetails& details) { |
| 1390 int controller_id = -1; | 1391 int controller_id = -1; |
| 1391 uintptr_t window_or_tab = source.map_key(); | 1392 uintptr_t window_or_tab = source.map_key(); |
| 1392 MetricsLog::WindowEventType window_type; | 1393 MetricsLog::WindowEventType window_type; |
| 1393 | 1394 |
| 1394 // Note: since we stop all logging when a single OTR session is active, it is | 1395 // Note: since we stop all logging when a single OTR session is active, it is |
| 1395 // possible that we start getting notifications about a window that we don't | 1396 // possible that we start getting notifications about a window that we don't |
| 1396 // know about. | 1397 // know about. |
| 1397 if (window_map_.find(window_or_tab) == window_map_.end()) { | 1398 if (window_map_.find(window_or_tab) == window_map_.end()) { |
| 1398 controller_id = next_window_id_++; | 1399 controller_id = next_window_id_++; |
| 1399 window_map_[window_or_tab] = controller_id; | 1400 window_map_[window_or_tab] = controller_id; |
| 1400 } else { | 1401 } else { |
| 1401 controller_id = window_map_[window_or_tab]; | 1402 controller_id = window_map_[window_or_tab]; |
| 1402 } | 1403 } |
| 1403 DCHECK_NE(controller_id, -1); | 1404 DCHECK_NE(controller_id, -1); |
| 1404 | 1405 |
| 1405 switch (type.value) { | 1406 switch (type) { |
| 1406 case NotificationType::TAB_PARENTED: | 1407 case content::NOTIFICATION_TAB_PARENTED: |
| 1407 case NotificationType::BROWSER_OPENED: | 1408 case chrome::NOTIFICATION_BROWSER_OPENED: |
| 1408 window_type = MetricsLog::WINDOW_CREATE; | 1409 window_type = MetricsLog::WINDOW_CREATE; |
| 1409 break; | 1410 break; |
| 1410 | 1411 |
| 1411 case NotificationType::TAB_CLOSING: | 1412 case content::NOTIFICATION_TAB_CLOSING: |
| 1412 case NotificationType::BROWSER_CLOSED: | 1413 case chrome::NOTIFICATION_BROWSER_CLOSED: |
| 1413 window_map_.erase(window_map_.find(window_or_tab)); | 1414 window_map_.erase(window_map_.find(window_or_tab)); |
| 1414 window_type = MetricsLog::WINDOW_DESTROY; | 1415 window_type = MetricsLog::WINDOW_DESTROY; |
| 1415 break; | 1416 break; |
| 1416 | 1417 |
| 1417 default: | 1418 default: |
| 1418 NOTREACHED(); | 1419 NOTREACHED(); |
| 1419 return; | 1420 return; |
| 1420 } | 1421 } |
| 1421 | 1422 |
| 1422 // TODO(brettw) we should have some kind of ID for the parent. | 1423 // TODO(brettw) we should have some kind of ID for the parent. |
| 1423 current_log_->RecordWindowEvent(window_type, controller_id, 0); | 1424 current_log_->RecordWindowEvent(window_type, controller_id, 0); |
| 1424 } | 1425 } |
| 1425 | 1426 |
| 1426 void MetricsService::LogLoadComplete(NotificationType type, | 1427 void MetricsService::LogLoadComplete(int type, |
| 1427 const NotificationSource& source, | 1428 const NotificationSource& source, |
| 1428 const NotificationDetails& details) { | 1429 const NotificationDetails& details) { |
| 1429 if (details == NotificationService::NoDetails()) | 1430 if (details == NotificationService::NoDetails()) |
| 1430 return; | 1431 return; |
| 1431 | 1432 |
| 1432 // TODO(jar): There is a bug causing this to be called too many times, and | 1433 // TODO(jar): There is a bug causing this to be called too many times, and |
| 1433 // the log overflows. For now, we won't record these events. | 1434 // the log overflows. For now, we won't record these events. |
| 1434 UMA_HISTOGRAM_COUNTS("UMA.LogLoadComplete called", 1); | 1435 UMA_HISTOGRAM_COUNTS("UMA.LogLoadComplete called", 1); |
| 1435 return; | 1436 return; |
| 1436 | 1437 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1490 IncrementPrefValue(prefs::kStabilitySystemUncleanShutdownCount); | 1491 IncrementPrefValue(prefs::kStabilitySystemUncleanShutdownCount); |
| 1491 else | 1492 else |
| 1492 NOTREACHED() << "Unexpected Chrome OS crash type " << crash_type; | 1493 NOTREACHED() << "Unexpected Chrome OS crash type " << crash_type; |
| 1493 // Wake up metrics logs sending if necessary now that new | 1494 // Wake up metrics logs sending if necessary now that new |
| 1494 // log data is available. | 1495 // log data is available. |
| 1495 HandleIdleSinceLastTransmission(false); | 1496 HandleIdleSinceLastTransmission(false); |
| 1496 } | 1497 } |
| 1497 #endif // OS_CHROMEOS | 1498 #endif // OS_CHROMEOS |
| 1498 | 1499 |
| 1499 void MetricsService::LogChildProcessChange( | 1500 void MetricsService::LogChildProcessChange( |
| 1500 NotificationType type, | 1501 int type, |
| 1501 const NotificationSource& source, | 1502 const NotificationSource& source, |
| 1502 const NotificationDetails& details) { | 1503 const NotificationDetails& details) { |
| 1503 Details<ChildProcessInfo> child_details(details); | 1504 Details<ChildProcessInfo> child_details(details); |
| 1504 const std::wstring& child_name = child_details->name(); | 1505 const std::wstring& child_name = child_details->name(); |
| 1505 | 1506 |
| 1506 if (child_process_stats_buffer_.find(child_name) == | 1507 if (child_process_stats_buffer_.find(child_name) == |
| 1507 child_process_stats_buffer_.end()) { | 1508 child_process_stats_buffer_.end()) { |
| 1508 child_process_stats_buffer_[child_name] = | 1509 child_process_stats_buffer_[child_name] = |
| 1509 ChildProcessStats(child_details->type()); | 1510 ChildProcessStats(child_details->type()); |
| 1510 } | 1511 } |
| 1511 | 1512 |
| 1512 ChildProcessStats& stats = child_process_stats_buffer_[child_name]; | 1513 ChildProcessStats& stats = child_process_stats_buffer_[child_name]; |
| 1513 switch (type.value) { | 1514 switch (type) { |
| 1514 case NotificationType::CHILD_PROCESS_HOST_CONNECTED: | 1515 case content::NOTIFICATION_CHILD_PROCESS_HOST_CONNECTED: |
| 1515 stats.process_launches++; | 1516 stats.process_launches++; |
| 1516 break; | 1517 break; |
| 1517 | 1518 |
| 1518 case NotificationType::CHILD_INSTANCE_CREATED: | 1519 case content::NOTIFICATION_CHILD_INSTANCE_CREATED: |
| 1519 stats.instances++; | 1520 stats.instances++; |
| 1520 break; | 1521 break; |
| 1521 | 1522 |
| 1522 case NotificationType::CHILD_PROCESS_CRASHED: | 1523 case content::NOTIFICATION_CHILD_PROCESS_CRASHED: |
| 1523 stats.process_crashes++; | 1524 stats.process_crashes++; |
| 1524 // Exclude plugin crashes from the count below because we report them via | 1525 // Exclude plugin crashes from the count below because we report them via |
| 1525 // a separate UMA metric. | 1526 // a separate UMA metric. |
| 1526 if (child_details->type() != ChildProcessInfo::PLUGIN_PROCESS) { | 1527 if (child_details->type() != ChildProcessInfo::PLUGIN_PROCESS) { |
| 1527 IncrementPrefValue(prefs::kStabilityChildProcessCrashCount); | 1528 IncrementPrefValue(prefs::kStabilityChildProcessCrashCount); |
| 1528 } | 1529 } |
| 1529 break; | 1530 break; |
| 1530 | 1531 |
| 1531 default: | 1532 default: |
| 1532 NOTREACHED() << "Unexpected notification type " << type.value; | 1533 NOTREACHED() << "Unexpected notification type " << type; |
| 1533 return; | 1534 return; |
| 1534 } | 1535 } |
| 1535 } | 1536 } |
| 1536 | 1537 |
| 1537 // Recursively counts the number of bookmarks and folders in node. | 1538 // Recursively counts the number of bookmarks and folders in node. |
| 1538 static void CountBookmarks(const BookmarkNode* node, | 1539 static void CountBookmarks(const BookmarkNode* node, |
| 1539 int* bookmarks, | 1540 int* bookmarks, |
| 1540 int* folders) { | 1541 int* folders) { |
| 1541 if (node->is_url()) | 1542 if (node->is_url()) |
| 1542 (*bookmarks)++; | 1543 (*bookmarks)++; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 stats.process_launches); | 1653 stats.process_launches); |
| 1653 plugin_dict->SetInteger(prefs::kStabilityPluginCrashes, | 1654 plugin_dict->SetInteger(prefs::kStabilityPluginCrashes, |
| 1654 stats.process_crashes); | 1655 stats.process_crashes); |
| 1655 plugin_dict->SetInteger(prefs::kStabilityPluginInstances, | 1656 plugin_dict->SetInteger(prefs::kStabilityPluginInstances, |
| 1656 stats.instances); | 1657 stats.instances); |
| 1657 plugins->Append(plugin_dict); | 1658 plugins->Append(plugin_dict); |
| 1658 } | 1659 } |
| 1659 child_process_stats_buffer_.clear(); | 1660 child_process_stats_buffer_.clear(); |
| 1660 } | 1661 } |
| 1661 | 1662 |
| 1662 bool MetricsService::CanLogNotification(NotificationType type, | 1663 bool MetricsService::CanLogNotification(int type, |
| 1663 const NotificationSource& source, | 1664 const NotificationSource& source, |
| 1664 const NotificationDetails& details) { | 1665 const NotificationDetails& details) { |
| 1665 // We simply don't log anything to UMA if there is a single incognito | 1666 // We simply don't log anything to UMA if there is a single incognito |
| 1666 // session visible. The problem is that we always notify using the orginal | 1667 // session visible. The problem is that we always notify using the orginal |
| 1667 // profile in order to simplify notification processing. | 1668 // profile in order to simplify notification processing. |
| 1668 return !BrowserList::IsOffTheRecordSessionActive(); | 1669 return !BrowserList::IsOffTheRecordSessionActive(); |
| 1669 } | 1670 } |
| 1670 | 1671 |
| 1671 void MetricsService::RecordBooleanPrefValue(const char* path, bool value) { | 1672 void MetricsService::RecordBooleanPrefValue(const char* path, bool value) { |
| 1672 DCHECK(IsSingleThreaded()); | 1673 DCHECK(IsSingleThreaded()); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1690 thread_id = base::PlatformThread::CurrentId(); | 1691 thread_id = base::PlatformThread::CurrentId(); |
| 1691 return base::PlatformThread::CurrentId() == thread_id; | 1692 return base::PlatformThread::CurrentId() == thread_id; |
| 1692 } | 1693 } |
| 1693 | 1694 |
| 1694 #if defined(OS_CHROMEOS) | 1695 #if defined(OS_CHROMEOS) |
| 1695 void MetricsService::StartExternalMetrics() { | 1696 void MetricsService::StartExternalMetrics() { |
| 1696 external_metrics_ = new chromeos::ExternalMetrics; | 1697 external_metrics_ = new chromeos::ExternalMetrics; |
| 1697 external_metrics_->Start(); | 1698 external_metrics_->Start(); |
| 1698 } | 1699 } |
| 1699 #endif | 1700 #endif |
| OLD | NEW |