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

Side by Side Diff: chrome/browser/google/google_update_win.cc

Issue 659333003: Record histograms for on-demand update check results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: doh Created 6 years, 2 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 (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/google/google_update_win.h" 5 #include "chrome/browser/google/google_update_win.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlcom.h> 8 #include <atlcom.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/metrics/histogram.h"
14 #include "base/metrics/sparse_histogram.h"
13 #include "base/path_service.h" 15 #include "base/path_service.h"
14 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
15 #include "base/strings/stringprintf.h" 17 #include "base/strings/stringprintf.h"
16 #include "base/threading/thread.h" 18 #include "base/threading/thread.h"
17 #include "base/win/scoped_comptr.h" 19 #include "base/win/scoped_comptr.h"
18 #include "base/win/windows_version.h" 20 #include "base/win/windows_version.h"
19 #include "chrome/grit/generated_resources.h" 21 #include "chrome/grit/generated_resources.h"
20 #include "chrome/installer/util/browser_distribution.h" 22 #include "chrome/installer/util/browser_distribution.h"
21 #include "chrome/installer/util/google_update_settings.h" 23 #include "chrome/installer/util/google_update_settings.h"
22 #include "chrome/installer/util/helper.h" 24 #include "chrome/installer/util/helper.h"
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 job_holder = NULL; 386 job_holder = NULL;
385 on_demand = NULL; 387 on_demand = NULL;
386 } 388 }
387 389
388 void GoogleUpdate::ReportResults(GoogleUpdateUpgradeResult results, 390 void GoogleUpdate::ReportResults(GoogleUpdateUpgradeResult results,
389 GoogleUpdateErrorCode error_code, 391 GoogleUpdateErrorCode error_code,
390 const base::string16& error_message) { 392 const base::string16& error_message) {
391 // If there is an error, then error code must not be blank, and vice versa. 393 // If there is an error, then error code must not be blank, and vice versa.
392 DCHECK(results == UPGRADE_ERROR ? error_code != GOOGLE_UPDATE_NO_ERROR : 394 DCHECK(results == UPGRADE_ERROR ? error_code != GOOGLE_UPDATE_NO_ERROR :
393 error_code == GOOGLE_UPDATE_NO_ERROR); 395 error_code == GOOGLE_UPDATE_NO_ERROR);
396 UMA_HISTOGRAM_ENUMERATION(
397 "GoogleUpdate.UpgradeResult", results, NUM_UPGRADE_RESULTS);
398 if (results == UPGRADE_ERROR) {
399 UMA_HISTOGRAM_ENUMERATION(
400 "GoogleUpdate.UpdateErrorCode", error_code, NUM_ERROR_CODES);
401 }
394 if (listener_) { 402 if (listener_) {
395 listener_->OnReportResults( 403 listener_->OnReportResults(
396 results, error_code, error_message, version_available_); 404 results, error_code, error_message, version_available_);
397 } 405 }
398 } 406 }
399 407
400 bool GoogleUpdate::ReportFailure(HRESULT hr, 408 bool GoogleUpdate::ReportFailure(HRESULT hr,
401 GoogleUpdateErrorCode error_code, 409 GoogleUpdateErrorCode error_code,
402 const base::string16& error_message, 410 const base::string16& error_message,
403 base::MessageLoop* main_loop) { 411 base::MessageLoop* main_loop) {
404 DLOG(ERROR) << "Communication with Google Update failed: " << hr 412 DLOG(ERROR) << "Communication with Google Update failed: " << hr
405 << " error: " << error_code 413 << " error: " << error_code
406 << ", message: " << error_message.c_str(); 414 << ", message: " << error_message.c_str();
415 UMA_HISTOGRAM_SPARSE_SLOWLY("GoogleUpdate.ErrorHresult", hr);
407 main_loop->PostTask( 416 main_loop->PostTask(
408 FROM_HERE, 417 FROM_HERE,
409 base::Bind(&GoogleUpdate::ReportResults, this, 418 base::Bind(&GoogleUpdate::ReportResults, this,
410 UPGRADE_ERROR, error_code, error_message)); 419 UPGRADE_ERROR, error_code, error_message));
411 return false; 420 return false;
412 } 421 }
OLDNEW
« no previous file with comments | « chrome/browser/google/google_update_win.h ('k') | chrome/browser/ui/webui/help/version_updater_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698