Chromium Code Reviews| Index: content/browser/in_process_webkit/indexed_db_context.cc |
| diff --git a/content/browser/in_process_webkit/indexed_db_context.cc b/content/browser/in_process_webkit/indexed_db_context.cc |
| index aacc5b9d3c9ab00bfe52405d2d4529eff1df6780..13c414eb5edcbbc7b8ebf9714e995aa6868adb9a 100644 |
| --- a/content/browser/in_process_webkit/indexed_db_context.cc |
| +++ b/content/browser/in_process_webkit/indexed_db_context.cc |
| @@ -12,6 +12,7 @@ |
| #include "content/browser/browser_thread.h" |
| #include "content/browser/in_process_webkit/indexed_db_quota_client.h" |
| #include "content/browser/in_process_webkit/webkit_context.h" |
| +#include "content/common/url_constants.h" |
| #include "googleurl/src/gurl.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebCString.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabase.h" |
| @@ -118,3 +119,28 @@ bool IndexedDBContext::IsUnlimitedStorageGranted( |
| const GURL& origin) const { |
| return special_storage_policy_->IsStorageUnlimited(origin); |
| } |
| + |
| +// TODO(dgrogan): Merge this code with the similar loop in |
| +// BrowsingDataIndexedDBHelperImpl::FetchIndexedDBInfoInWebKitThread. |
| +void IndexedDBContext::GetAllOriginIdentifiers( |
| + std::vector<string16>* origin_ids) { |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
| + file_util::FileEnumerator file_enumerator(data_path_, |
| + false, file_util::FileEnumerator::DIRECTORIES); |
| + for (FilePath file_path = file_enumerator.Next(); !file_path.empty(); |
| + file_path = file_enumerator.Next()) { |
| + if (file_path.Extension() == IndexedDBContext::kIndexedDBExtension) { |
| + WebKit::WebString origin_id_webstring = |
| + webkit_glue::FilePathToWebString(file_path.BaseName()); |
| + string16 origin_id = origin_id_webstring; |
| + WebSecurityOrigin web_security_origin = |
| + WebSecurityOrigin::createFromDatabaseIdentifier(origin_id_webstring); |
| + if (EqualsASCII(web_security_origin.protocol(), |
| + chrome::kExtensionScheme)) { |
|
michaeln
2011/07/07 21:33:56
I don't think extension origins should be filtered
dgrogan
2011/07/07 21:55:37
Done.
|
| + // Extension state is not considered browsing data. |
| + continue; |
| + } |
| + origin_ids->push_back(origin_id); |
| + } |
| + } |
| +} |