Chromium Code Reviews| Index: content/browser/in_process_webkit/dom_storage_context.cc |
| diff --git a/content/browser/in_process_webkit/dom_storage_context.cc b/content/browser/in_process_webkit/dom_storage_context.cc |
| index 3daa66ea5566e670c4ea27da29d7b5be03b16ec6..36648105b1593ff33c55206fac230c0ef7cd78e8 100644 |
| --- a/content/browser/in_process_webkit/dom_storage_context.cc |
| +++ b/content/browser/in_process_webkit/dom_storage_context.cc |
| @@ -198,6 +198,27 @@ void DOMStorageContext::DeleteDataModifiedSince(const base::Time& cutoff) { |
| } |
| } |
| +void DOMStorageContext::DeleteSessionOnlyData() { |
|
michaeln
2011/08/17 19:16:41
maybe DCHECK(BrowserThread::CurrentlyOn(BrowserThr
marja
2011/08/18 11:22:14
Done.
|
| + // Make sure that we don't delete a database that's currently being accessed |
| + // by unloading all of the databases temporarily. |
| + PurgeMemory(); |
| + |
| + file_util::FileEnumerator file_enumerator( |
| + data_path_.Append(kLocalStorageDirectory), false, |
| + file_util::FileEnumerator::FILES); |
| + for (FilePath path = file_enumerator.Next(); !path.value().empty(); |
| + path = file_enumerator.Next()) { |
| + GURL origin(WebSecurityOrigin::createFromDatabaseIdentifier( |
| + webkit_glue::FilePathToWebString(path.BaseName())).toString()); |
| + if (!special_storage_policy_->IsStorageSessionOnly(origin)) |
| + continue; |
| + if (special_storage_policy_->IsStorageProtected(origin)) |
| + continue; |
| + |
| + file_util::Delete(path, false); |
| + } |
| +} |
| + |
| void DOMStorageContext::DeleteLocalStorageFile(const FilePath& file_path) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |