Index: content/browser/storage_partition_impl.cc |
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc |
index fbee33d70bea79670fb3dcafe08856453e5cdea8..d02aa6f380f5ec5fc39011befbc0611622b61fa0 100644 |
--- a/content/browser/storage_partition_impl.cc |
+++ b/content/browser/storage_partition_impl.cc |
@@ -6,6 +6,7 @@ |
#include "base/utf_string_conversions.h" |
#include "content/browser/fileapi/browser_file_system_helper.h" |
+#include "content/browser/gpu/shader_disk_cache.h" |
#include "content/public/browser/browser_context.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/dom_storage_context.h" |
@@ -104,6 +105,19 @@ void ClearAllDataOnIOThread( |
} |
} |
+void ClearedShaderCacheOnIOThread(base::Closure callback) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback); |
+} |
+ |
+void ClearShaderCacheOnIOThread(base::FilePath context_path, |
+ base::Time begin, base::Time end, base::Closure callback) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
+ ShaderCacheFactory::GetInstance()->ClearByPath( |
+ context_path, begin, end, |
+ base::Bind(&ClearedShaderCacheOnIOThread, callback)); |
+} |
+ |
void OnLocalStorageUsageInfo( |
const scoped_refptr<DOMStorageContextImpl>& dom_storage_context, |
const std::vector<dom_storage::LocalStorageUsageInfo>& infos) { |
@@ -127,6 +141,7 @@ void OnSessionStorageUsageInfo( |
} // namespace |
StoragePartitionImpl::StoragePartitionImpl( |
+ const base::FilePath& context_path, |
jam
2013/03/26 17:04:16
this makes me wonder, should the shader cache be p
|
const base::FilePath& partition_path, |
quota::QuotaManager* quota_manager, |
ChromeAppCacheService* appcache_service, |
@@ -134,7 +149,8 @@ StoragePartitionImpl::StoragePartitionImpl( |
webkit_database::DatabaseTracker* database_tracker, |
DOMStorageContextImpl* dom_storage_context, |
IndexedDBContextImpl* indexed_db_context) |
- : partition_path_(partition_path), |
+ : context_path_(context_path), |
+ partition_path_(partition_path), |
quota_manager_(quota_manager), |
appcache_service_(appcache_service), |
filesystem_context_(filesystem_context), |
@@ -206,7 +222,8 @@ StoragePartitionImpl* StoragePartitionImpl::Create( |
scoped_refptr<ChromeAppCacheService> appcache_service = |
new ChromeAppCacheService(quota_manager->proxy()); |
- return new StoragePartitionImpl(partition_path, |
+ return new StoragePartitionImpl(context->GetPath(), |
+ partition_path, |
quota_manager, |
appcache_service, |
filesystem_context, |
@@ -293,6 +310,20 @@ void StoragePartitionImpl::AsyncClearData(uint32 storage_mask) { |
} |
} |
+void StoragePartitionImpl::AsyncClearDataBetween(uint32 storage_mask, |
+ const base::Time& begin, const base::Time& end, |
+ const base::Closure& callback) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ DCHECK(storage_mask == kShaderStorage); |
+ |
+ if (storage_mask & kShaderStorage) { |
+ BrowserThread::PostTask( |
+ BrowserThread::IO, FROM_HERE, |
+ base::Bind(&ClearShaderCacheOnIOThread, context_path_, begin, end, |
+ callback)); |
+ } |
+} |
+ |
void StoragePartitionImpl::SetURLRequestContext( |
net::URLRequestContextGetter* url_request_context) { |
url_request_context_ = url_request_context; |