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

Side by Side Diff: chrome/browser/component_updater/component_updater_service.cc

Issue 17551012: Fix error handling when download of component updates fails. This line (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698