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 8165724d3047a9d5eaa3a5f43055372bd9bca0b2..8afd98c282af82fc9bd6a2407a8f6c2baadb63fd 100644 |
--- a/content/browser/in_process_webkit/indexed_db_context.cc |
+++ b/content/browser/in_process_webkit/indexed_db_context.cc |
@@ -38,7 +38,7 @@ void GetAllOriginsAndPaths( |
const FilePath& indexeddb_path, |
std::vector<GURL>* origins, |
std::vector<FilePath>* file_paths) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
if (indexeddb_path.empty()) |
return; |
file_util::FileEnumerator file_enumerator(indexeddb_path, |
@@ -62,7 +62,7 @@ void ClearLocalState( |
const FilePath& indexeddb_path, |
bool clear_all_databases, |
scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
std::vector<GURL> origins; |
std::vector<FilePath> file_paths; |
GetAllOriginsAndPaths(indexeddb_path, &origins, &file_paths); |
@@ -109,8 +109,11 @@ IndexedDBContext::IndexedDBContext( |
IndexedDBContext::~IndexedDBContext() { |
WebKit::WebIDBFactory* factory = idb_factory_.release(); |
- if (factory) |
- BrowserThread::DeleteSoon(BrowserThread::WEBKIT, FROM_HERE, factory); |
+ if (factory) { |
+ if (!BrowserThread::DeleteSoon(BrowserThread::WEBKIT_DEPRECATED, |
+ FROM_HERE, factory)) |
+ delete factory; |
+ } |
if (data_path_.empty()) |
return; |
@@ -129,13 +132,13 @@ IndexedDBContext::~IndexedDBContext() { |
// No WEBKIT thread here means we are running in a unit test where no clean |
// up is needed. |
BrowserThread::PostTask( |
- BrowserThread::WEBKIT, FROM_HERE, |
+ BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, |
base::Bind(&ClearLocalState, data_path_, clear_local_state_on_exit_, |
special_storage_policy_)); |
} |
WebIDBFactory* IndexedDBContext::GetIDBFactory() { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
if (!idb_factory_.get()) { |
// Prime our cache of origins with existing databases so we can |
// detect when dbs are newly created. |
@@ -146,7 +149,7 @@ WebIDBFactory* IndexedDBContext::GetIDBFactory() { |
} |
void IndexedDBContext::DeleteIndexedDBForOrigin(const GURL& origin_url) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
if (data_path_.empty() || !IsInOriginSet(origin_url)) |
return; |
// TODO(michaeln): When asked to delete an origin with open connections, |
@@ -166,7 +169,7 @@ void IndexedDBContext::DeleteIndexedDBForOrigin(const GURL& origin_url) { |
} |
void IndexedDBContext::GetAllOrigins(std::vector<GURL>* origins) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
std::set<GURL>* origins_set = GetOriginSet(); |
for (std::set<GURL>::const_iterator iter = origins_set->begin(); |
iter != origins_set->end(); ++iter) { |
@@ -296,20 +299,20 @@ void IndexedDBContext::GotUsageAndQuota(const GURL& origin_url, |
return; |
} |
BrowserThread::PostTask( |
- BrowserThread::WEBKIT, FROM_HERE, |
+ BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, |
base::Bind(&IndexedDBContext::GotUpdatedQuota, this, origin_url, usage, |
quota)); |
} |
void IndexedDBContext::GotUpdatedQuota(const GURL& origin_url, int64 usage, |
int64 quota) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
space_available_map_[origin_url] = quota - usage; |
} |
void IndexedDBContext::QueryAvailableQuota(const GURL& origin_url) { |
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT)); |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED)); |
if (quota_manager_proxy()) |
BrowserThread::PostTask( |
BrowserThread::IO, FROM_HERE, |