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..44da402594d2e46cc0ea4e3fbea7695705e6f851 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 path, |
+ base::Time begin, base::Time end, base::Closure callback) { |
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
+ ShaderCacheFactory::GetInstance()->ClearByPath( |
+ path, begin, end, |
+ base::Bind(&ClearedShaderCacheOnIOThread, callback)); |
+} |
+ |
void OnLocalStorageUsageInfo( |
const scoped_refptr<DOMStorageContextImpl>& dom_storage_context, |
const std::vector<dom_storage::LocalStorageUsageInfo>& infos) { |
@@ -293,6 +307,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, GetPath(), begin, end, |
+ callback)); |
+ } |
+} |
+ |
void StoragePartitionImpl::SetURLRequestContext( |
net::URLRequestContextGetter* url_request_context) { |
url_request_context_ = url_request_context; |