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/component_updater/component_updater_service.h" | 5 #include "chrome/browser/component_updater/component_updater_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 CRXContext* context) { | 873 CRXContext* context) { |
874 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 874 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
875 int error_code = net::OK; | 875 int error_code = net::OK; |
876 | 876 |
877 CrxUpdateItem* crx = FindUpdateItemById(context->id); | 877 CrxUpdateItem* crx = FindUpdateItemById(context->id); |
878 DCHECK(crx->status == CrxUpdateItem::kDownloadingDiff || | 878 DCHECK(crx->status == CrxUpdateItem::kDownloadingDiff || |
879 crx->status == CrxUpdateItem::kDownloading); | 879 crx->status == CrxUpdateItem::kDownloading); |
880 | 880 |
881 if (source->FileErrorOccurred(&error_code) || !FetchSuccess(*source)) { | 881 if (source->FileErrorOccurred(&error_code) || !FetchSuccess(*source)) { |
882 if (crx->status == CrxUpdateItem::kDownloadingDiff) { | 882 if (crx->status == CrxUpdateItem::kDownloadingDiff) { |
| 883 crx->diff_update_failed = true; |
883 size_t count = ChangeItemStatus(CrxUpdateItem::kDownloadingDiff, | 884 size_t count = ChangeItemStatus(CrxUpdateItem::kDownloadingDiff, |
884 CrxUpdateItem::kCanUpdate); | 885 CrxUpdateItem::kCanUpdate); |
885 DCHECK_EQ(count, 1ul); | 886 DCHECK_EQ(count, 1ul); |
886 ScheduleNextRun(true); | 887 ScheduleNextRun(true); |
887 return; | 888 return; |
888 } | 889 } |
889 size_t count = ChangeItemStatus(CrxUpdateItem::kDownloading, | 890 size_t count = ChangeItemStatus(CrxUpdateItem::kDownloading, |
890 CrxUpdateItem::kNoUpdate); | 891 CrxUpdateItem::kNoUpdate); |
891 DCHECK_EQ(count, 1ul); | 892 DCHECK_EQ(count, 1ul); |
892 config_->OnEvent(Configurator::kNetworkError, CrxIdtoUMAId(context->id)); | 893 config_->OnEvent(Configurator::kNetworkError, CrxIdtoUMAId(context->id)); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 ScheduleNextRun(false); | 995 ScheduleNextRun(false); |
995 } | 996 } |
996 | 997 |
997 // The component update factory. Using the component updater as a singleton | 998 // The component update factory. Using the component updater as a singleton |
998 // is the job of the browser process. | 999 // is the job of the browser process. |
999 ComponentUpdateService* ComponentUpdateServiceFactory( | 1000 ComponentUpdateService* ComponentUpdateServiceFactory( |
1000 ComponentUpdateService::Configurator* config) { | 1001 ComponentUpdateService::Configurator* config) { |
1001 DCHECK(config); | 1002 DCHECK(config); |
1002 return new CrxUpdateService(config); | 1003 return new CrxUpdateService(config); |
1003 } | 1004 } |
OLD | NEW |