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

Side by Side Diff: chrome/browser/browsing_data_appcache_helper.cc

Issue 10454113: Renaming `BrowsingDataHelper::IsValidScheme`, as it's poorly descriptive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bernhard. Created 8 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 | chrome/browser/browsing_data_database_helper.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) 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/browsing_data_appcache_helper.h" 5 #include "chrome/browser/browsing_data_appcache_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "chrome/browser/browsing_data_helper.h" 9 #include "chrome/browser/browsing_data_helper.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 void BrowsingDataAppCacheHelper::OnFetchComplete(int rv) { 64 void BrowsingDataAppCacheHelper::OnFetchComplete(int rv) {
65 if (BrowserThread::CurrentlyOn(BrowserThread::IO)) { 65 if (BrowserThread::CurrentlyOn(BrowserThread::IO)) {
66 // Filter out appcache info entries for non-websafe schemes. Extension state 66 // Filter out appcache info entries for non-websafe schemes. Extension state
67 // and DevTools, for example, are not considered browsing data. 67 // and DevTools, for example, are not considered browsing data.
68 typedef std::map<GURL, appcache::AppCacheInfoVector> InfoByOrigin; 68 typedef std::map<GURL, appcache::AppCacheInfoVector> InfoByOrigin;
69 InfoByOrigin& origin_map = info_collection_->infos_by_origin; 69 InfoByOrigin& origin_map = info_collection_->infos_by_origin;
70 for (InfoByOrigin::iterator origin = origin_map.begin(); 70 for (InfoByOrigin::iterator origin = origin_map.begin();
71 origin != origin_map.end();) { 71 origin != origin_map.end();) {
72 InfoByOrigin::iterator current = origin; 72 InfoByOrigin::iterator current = origin;
73 ++origin; 73 ++origin;
74 if (!BrowsingDataHelper::HasValidScheme(current->first)) 74 if (!BrowsingDataHelper::HasWebScheme(current->first))
75 origin_map.erase(current); 75 origin_map.erase(current);
76 } 76 }
77 77
78 BrowserThread::PostTask( 78 BrowserThread::PostTask(
79 BrowserThread::UI, FROM_HERE, 79 BrowserThread::UI, FROM_HERE,
80 base::Bind(&BrowsingDataAppCacheHelper::OnFetchComplete, this, rv)); 80 base::Bind(&BrowsingDataAppCacheHelper::OnFetchComplete, this, rv));
81 return; 81 return;
82 } 82 }
83 83
84 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 84 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 13 matching lines...) Expand all
98 CannedBrowsingDataAppCacheHelper* CannedBrowsingDataAppCacheHelper::Clone() { 98 CannedBrowsingDataAppCacheHelper* CannedBrowsingDataAppCacheHelper::Clone() {
99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
100 CannedBrowsingDataAppCacheHelper* clone = 100 CannedBrowsingDataAppCacheHelper* clone =
101 new CannedBrowsingDataAppCacheHelper(profile_); 101 new CannedBrowsingDataAppCacheHelper(profile_);
102 102
103 clone->info_collection_->infos_by_origin = info_collection_->infos_by_origin; 103 clone->info_collection_->infos_by_origin = info_collection_->infos_by_origin;
104 return clone; 104 return clone;
105 } 105 }
106 106
107 void CannedBrowsingDataAppCacheHelper::AddAppCache(const GURL& manifest_url) { 107 void CannedBrowsingDataAppCacheHelper::AddAppCache(const GURL& manifest_url) {
108 if (!BrowsingDataHelper::HasValidScheme(manifest_url)) 108 if (!BrowsingDataHelper::HasWebScheme(manifest_url))
109 return; // Ignore non-websafe schemes. 109 return; // Ignore non-websafe schemes.
110 110
111 OriginAppCacheInfoMap& origin_map = info_collection_->infos_by_origin; 111 OriginAppCacheInfoMap& origin_map = info_collection_->infos_by_origin;
112 appcache::AppCacheInfoVector& appcache_infos_ = 112 appcache::AppCacheInfoVector& appcache_infos_ =
113 origin_map[manifest_url.GetOrigin()]; 113 origin_map[manifest_url.GetOrigin()];
114 114
115 for (appcache::AppCacheInfoVector::iterator 115 for (appcache::AppCacheInfoVector::iterator
116 appcache = appcache_infos_.begin(); appcache != appcache_infos_.end(); 116 appcache = appcache_infos_.begin(); appcache != appcache_infos_.end();
117 ++appcache) { 117 ++appcache) {
118 if (appcache->manifest_url == manifest_url) 118 if (appcache->manifest_url == manifest_url)
(...skipping 28 matching lines...) Expand all
147 CannedBrowsingDataAppCacheHelper::GetOriginAppCacheInfoMap() const { 147 CannedBrowsingDataAppCacheHelper::GetOriginAppCacheInfoMap() const {
148 return info_collection_->infos_by_origin; 148 return info_collection_->infos_by_origin;
149 } 149 }
150 150
151 void CannedBrowsingDataAppCacheHelper::StartFetching( 151 void CannedBrowsingDataAppCacheHelper::StartFetching(
152 const base::Closure& completion_callback) { 152 const base::Closure& completion_callback) {
153 completion_callback.Run(); 153 completion_callback.Run();
154 } 154 }
155 155
156 CannedBrowsingDataAppCacheHelper::~CannedBrowsingDataAppCacheHelper() {} 156 CannedBrowsingDataAppCacheHelper::~CannedBrowsingDataAppCacheHelper() {}
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browsing_data_database_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698