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

Side by Side Diff: chrome/browser/browsing_data_local_storage_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
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_local_storage_helper.h" 5 #include "chrome/browser/browsing_data_local_storage_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } 85 }
86 86
87 void BrowsingDataLocalStorageHelper::FetchLocalStorageInfo( 87 void BrowsingDataLocalStorageHelper::FetchLocalStorageInfo(
88 const std::vector<FilePath>& files) { 88 const std::vector<FilePath>& files) {
89 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 89 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
90 for (size_t i = 0; i < files.size(); ++i) { 90 for (size_t i = 0; i < files.size(); ++i) {
91 FilePath file_path = files[i]; 91 FilePath file_path = files[i];
92 WebSecurityOrigin web_security_origin = 92 WebSecurityOrigin web_security_origin =
93 WebSecurityOrigin::createFromDatabaseIdentifier( 93 WebSecurityOrigin::createFromDatabaseIdentifier(
94 webkit_glue::FilePathToWebString(file_path.BaseName())); 94 webkit_glue::FilePathToWebString(file_path.BaseName()));
95 if (!BrowsingDataHelper::IsValidScheme(web_security_origin.protocol())) 95 if (!BrowsingDataHelper::IsWebScheme(web_security_origin.protocol()))
96 continue; // Non-websafe state is not considered browsing data. 96 continue; // Non-websafe state is not considered browsing data.
97 97
98 base::PlatformFileInfo file_info; 98 base::PlatformFileInfo file_info;
99 bool ret = file_util::GetFileInfo(file_path, &file_info); 99 bool ret = file_util::GetFileInfo(file_path, &file_info);
100 if (ret) { 100 if (ret) {
101 local_storage_info_.push_back(LocalStorageInfo( 101 local_storage_info_.push_back(LocalStorageInfo(
102 web_security_origin.protocol().utf8(), 102 web_security_origin.protocol().utf8(),
103 web_security_origin.host().utf8(), 103 web_security_origin.host().utf8(),
104 web_security_origin.port(), 104 web_security_origin.port(),
105 web_security_origin.databaseIdentifier().utf8(), 105 web_security_origin.databaseIdentifier().utf8(),
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 138 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
139 CannedBrowsingDataLocalStorageHelper* clone = 139 CannedBrowsingDataLocalStorageHelper* clone =
140 new CannedBrowsingDataLocalStorageHelper(profile_); 140 new CannedBrowsingDataLocalStorageHelper(profile_);
141 141
142 clone->pending_local_storage_info_ = pending_local_storage_info_; 142 clone->pending_local_storage_info_ = pending_local_storage_info_;
143 return clone; 143 return clone;
144 } 144 }
145 145
146 void CannedBrowsingDataLocalStorageHelper::AddLocalStorage( 146 void CannedBrowsingDataLocalStorageHelper::AddLocalStorage(
147 const GURL& origin) { 147 const GURL& origin) {
148 if (BrowsingDataHelper::HasValidScheme(origin)) 148 if (BrowsingDataHelper::HasWebScheme(origin))
149 pending_local_storage_info_.insert(origin); 149 pending_local_storage_info_.insert(origin);
150 } 150 }
151 151
152 void CannedBrowsingDataLocalStorageHelper::Reset() { 152 void CannedBrowsingDataLocalStorageHelper::Reset() {
153 pending_local_storage_info_.clear(); 153 pending_local_storage_info_.clear();
154 } 154 }
155 155
156 bool CannedBrowsingDataLocalStorageHelper::empty() const { 156 bool CannedBrowsingDataLocalStorageHelper::empty() const {
157 return pending_local_storage_info_.empty(); 157 return pending_local_storage_info_.empty();
158 } 158 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 GetFilePath(web_security_origin.databaseIdentifier()), 204 GetFilePath(web_security_origin.databaseIdentifier()),
205 0, 205 0,
206 base::Time())); 206 base::Time()));
207 } 207 }
208 208
209 BrowserThread::PostTask( 209 BrowserThread::PostTask(
210 BrowserThread::UI, FROM_HERE, 210 BrowserThread::UI, FROM_HERE,
211 base::Bind(&CannedBrowsingDataLocalStorageHelper::NotifyInUIThread, 211 base::Bind(&CannedBrowsingDataLocalStorageHelper::NotifyInUIThread,
212 this)); 212 this));
213 } 213 }
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data_indexed_db_helper.cc ('k') | chrome/browser/browsing_data_quota_helper_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698