Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1105)

Unified Diff: content/browser/storage_partition_impl.cc

Issue 12500009: Add the ability to clear the shader disk cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/storage_partition_impl.h ('k') | content/browser/storage_partition_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « content/browser/storage_partition_impl.h ('k') | content/browser/storage_partition_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698