OLD | NEW |
---|---|
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 Loading... | |
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 "UpdateCheckWin.UpgradeResult", results, NUM_UPGRADE_RESULTS); | |
Alexei Svitkine (slow)
2014/10/17 19:00:55
Can you use the existing GoogleUpdate. prefix inst
grt (UTC plus 2)
2014/10/18 02:37:34
Done.
| |
398 if (results == UPGRADE_ERROR) { | |
399 UMA_HISTOGRAM_ENUMERATION( | |
400 "UpdateCheckWin.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("UpdateCheckWin.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 } |
OLD | NEW |