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

Side by Side Diff: chrome/browser/extensions/extension_updater.cc

Issue 9152010: Merge 116258 - Hide downloads of extensions blacklist from web request API. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/963/src/
Patch Set: Created 8 years, 11 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 | chrome/browser/extensions/extension_webrequest_api.cc » ('j') | 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) 2011 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/extension_updater.h" 5 #include "chrome/browser/extensions/extension_updater.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 NotifyIfFinished(); 761 NotifyIfFinished();
762 return; 762 return;
763 } 763 }
764 764
765 // Examine the parsed manifest and kick off fetches of any new crx files. 765 // Examine the parsed manifest and kick off fetches of any new crx files.
766 std::vector<int> updates = DetermineUpdates(fetch_data, *results); 766 std::vector<int> updates = DetermineUpdates(fetch_data, *results);
767 for (size_t i = 0; i < updates.size(); i++) { 767 for (size_t i = 0; i < updates.size(); i++) {
768 const UpdateManifest::Result* update = &(results->list.at(updates[i])); 768 const UpdateManifest::Result* update = &(results->list.at(updates[i]));
769 const std::string& id = update->extension_id; 769 const std::string& id = update->extension_id;
770 in_progress_ids_.insert(id); 770 in_progress_ids_.insert(id);
771 if (id != std::string(kBlacklistAppID)) 771 if (id != std::string(kBlacklistAppID)) {
772 NotifyUpdateFound(update->extension_id); 772 NotifyUpdateFound(update->extension_id);
773 } else {
774 // The URL of the blacklist file is returned by the server and we need to
775 // be sure that we continue to be able to reliably detect whether a URL
776 // references a blacklist file.
777 DCHECK(extension_urls::IsBlacklistUpdateUrl(update->crx_url))
778 << update->crx_url;
779 }
773 FetchUpdatedExtension(update->extension_id, update->crx_url, 780 FetchUpdatedExtension(update->extension_id, update->crx_url,
774 update->package_hash, update->version); 781 update->package_hash, update->version);
775 } 782 }
776 783
777 // If the manifest response included a <daystart> element, we want to save 784 // If the manifest response included a <daystart> element, we want to save
778 // that value for any extensions which had sent a ping in the request. 785 // that value for any extensions which had sent a ping in the request.
779 if (fetch_data.base_url().DomainIs("google.com") && 786 if (fetch_data.base_url().DomainIs("google.com") &&
780 results->daystart_elapsed_seconds >= 0) { 787 results->daystart_elapsed_seconds >= 0) {
781 Time daystart = 788 Time daystart =
782 Time::Now() - TimeDelta::FromSeconds(results->daystart_elapsed_seconds); 789 Time::Now() - TimeDelta::FromSeconds(results->daystart_elapsed_seconds);
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 std::set<std::string>::const_iterator i; 1251 std::set<std::string>::const_iterator i;
1245 for (i = ids.begin(); i != ids.end(); ++i) 1252 for (i = ids.begin(); i != ids.end(); ++i)
1246 in_progress_ids_.insert(*i); 1253 in_progress_ids_.insert(*i);
1247 } 1254 }
1248 1255
1249 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) { 1256 void ExtensionUpdater::RemoveFromInProgress(const std::set<std::string>& ids) {
1250 std::set<std::string>::const_iterator i; 1257 std::set<std::string>::const_iterator i;
1251 for (i = ids.begin(); i != ids.end(); ++i) 1258 for (i = ids.begin(); i != ids.end(); ++i)
1252 in_progress_ids_.erase(*i); 1259 in_progress_ids_.erase(*i);
1253 } 1260 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_webrequest_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698