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

Side by Side Diff: chrome/browser/extensions/updater/extension_downloader.cc

Issue 139643005: Don't free id before accessing it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/extensions/updater/extension_downloader.h" 5 #include "chrome/browser/extensions/updater/extension_downloader.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 extensions_queue_.active_request_failure_count() < kMaxRetries) { 714 extensions_queue_.active_request_failure_count() < kMaxRetries) {
715 extensions_queue_.RetryRequest(backoff_delay); 715 extensions_queue_.RetryRequest(backoff_delay);
716 } else { 716 } else {
717 RETRY_HISTOGRAM("CrxFetchFailure", 717 RETRY_HISTOGRAM("CrxFetchFailure",
718 extensions_queue_.active_request_failure_count(), url); 718 extensions_queue_.active_request_failure_count(), url);
719 // status.error() is 0 (net::OK) or negative. (See net/base/net_errors.h) 719 // status.error() is 0 (net::OK) or negative. (See net/base/net_errors.h)
720 UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.CrxFetchError", -status.error()); 720 UMA_HISTOGRAM_SPARSE_SLOWLY("Extensions.CrxFetchError", -status.error());
721 delegate_->OnExtensionDownloadFailed( 721 delegate_->OnExtensionDownloadFailed(
722 id, ExtensionDownloaderDelegate::CRX_FETCH_FAILED, ping, request_ids); 722 id, ExtensionDownloaderDelegate::CRX_FETCH_FAILED, ping, request_ids);
723 } 723 }
724 ping_results_.erase(id);
724 extensions_queue_.reset_active_request(); 725 extensions_queue_.reset_active_request();
725 ping_results_.erase(id);
726 } 726 }
727 727
728 extension_fetcher_.reset(); 728 extension_fetcher_.reset();
729 729
730 // If there are any pending downloads left, start the next one. 730 // If there are any pending downloads left, start the next one.
731 extensions_queue_.StartNextRequest(); 731 extensions_queue_.StartNextRequest();
732 } 732 }
733 733
734 void ExtensionDownloader::NotifyExtensionsDownloadFailed( 734 void ExtensionDownloader::NotifyExtensionsDownloadFailed(
735 const std::set<std::string>& extension_ids, 735 const std::set<std::string>& extension_ids,
(...skipping 10 matching lines...) Expand all
746 void ExtensionDownloader::NotifyUpdateFound(const std::string& id, 746 void ExtensionDownloader::NotifyUpdateFound(const std::string& id,
747 const std::string& version) { 747 const std::string& version) {
748 UpdateDetails updateInfo(id, Version(version)); 748 UpdateDetails updateInfo(id, Version(version));
749 content::NotificationService::current()->Notify( 749 content::NotificationService::current()->Notify(
750 chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND, 750 chrome::NOTIFICATION_EXTENSION_UPDATE_FOUND,
751 content::NotificationService::AllBrowserContextsAndSources(), 751 content::NotificationService::AllBrowserContextsAndSources(),
752 content::Details<UpdateDetails>(&updateInfo)); 752 content::Details<UpdateDetails>(&updateInfo));
753 } 753 }
754 754
755 } // namespace extensions 755 } // namespace extensions
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