Chromium Code Reviews| Index: chrome/browser/chromeos/net/network_portal_detector.cc |
| diff --git a/chrome/browser/chromeos/net/network_portal_detector.cc b/chrome/browser/chromeos/net/network_portal_detector.cc |
| index 93c5d35aed26f14540d18908fbd44d0fcdc28d37..bd0137d57cd66874d3d5b8f359a5fd6a089b4739 100644 |
| --- a/chrome/browser/chromeos/net/network_portal_detector.cc |
| +++ b/chrome/browser/chromeos/net/network_portal_detector.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/command_line.h" |
| #include "base/logging.h" |
| #include "base/message_loop.h" |
| +#include "base/metrics/histogram.h" |
| #include "chrome/browser/browser_process.h" |
| #include "chrome/browser/chromeos/cros/cros_library.h" |
| #include "chrome/common/chrome_notification_types.h" |
| @@ -55,6 +56,8 @@ std::string CaptivePortalStatusString( |
| case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED: |
| return l10n_util::GetStringUTF8( |
| IDS_CHROMEOS_CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED); |
| + case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT: |
| + NOTREACHED(); |
| } |
| return l10n_util::GetStringUTF8( |
| IDS_CHROMEOS_CAPTIVE_PORTAL_STATUS_UNRECOGNIZED); |
| @@ -239,6 +242,8 @@ void NetworkPortalDetector::DetectCaptivePortal(const base::TimeDelta& delay) { |
| min_time_between_attempts_ - elapsed_time > next_attempt_delay_) { |
| next_attempt_delay_ = min_time_between_attempts_ - elapsed_time; |
| } |
| + } else { |
| + detection_start_time_ = GetCurrentTimeTicks(); |
| } |
| detection_task_.Reset( |
| base::Bind(&NetworkPortalDetector::DetectCaptivePortalTask, |
| @@ -366,6 +371,11 @@ void NetworkPortalDetector::SetCaptivePortalState( |
| const CaptivePortalState& state) { |
| DCHECK(network); |
| + if (!detection_start_time_.is_null()) { |
| + UMA_HISTOGRAM_LONG_TIMES("CaptivePortal.OOBE.DetectionDuration", |
|
Nikita (slow)
2013/02/11 16:26:41
Comment says: Use this macro when times can routin
ygorshenin1
2013/02/12 14:20:06
Done.
|
| + GetCurrentTimeTicks() - detection_start_time_); |
| + } |
| + |
| CaptivePortalStateMap::const_iterator it = |
| portal_state_map_.find(network->service_path()); |
| if (it == portal_state_map_.end() || |