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

Side by Side Diff: content/browser/storage_partition_impl.cc

Issue 13357004: Clear browsing data clears data for type kStorageTypeTemporary but not for kStorageTypeSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/storage_partition_impl.h" 5 #include "content/browser/storage_partition_impl.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "content/browser/fileapi/browser_file_system_helper.h" 8 #include "content/browser/fileapi/browser_file_system_helper.h"
9 #include "content/browser/gpu/shader_disk_cache.h" 9 #include "content/browser/gpu/shader_disk_cache.h"
10 #include "content/public/browser/browser_context.h" 10 #include "content/public/browser/browser_context.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 if (storage_mask & StoragePartition::kQuotaManagedTemporaryStorage) { 68 if (storage_mask & StoragePartition::kQuotaManagedTemporaryStorage) {
69 ClearQuotaManagedOriginsOnIOThread(quota_manager, 69 ClearQuotaManagedOriginsOnIOThread(quota_manager,
70 origins, 70 origins,
71 quota::kStorageTypeTemporary); 71 quota::kStorageTypeTemporary);
72 } 72 }
73 if (storage_mask & StoragePartition::kQuotaManagedPersistentStorage) { 73 if (storage_mask & StoragePartition::kQuotaManagedPersistentStorage) {
74 ClearQuotaManagedOriginsOnIOThread(quota_manager, 74 ClearQuotaManagedOriginsOnIOThread(quota_manager,
75 origins, 75 origins,
76 quota::kStorageTypePersistent); 76 quota::kStorageTypePersistent);
77 } 77 }
78 if (storage_mask & StoragePartition::kQuotaManagedSyncableStorage) {
79 ClearQuotaManagedOriginsOnIOThread(quota_manager,
80 origins,
81 quota::kStorageTypeSyncable);
82 }
78 } 83 }
79 84
80 void ClearAllDataOnIOThread( 85 void ClearAllDataOnIOThread(
81 uint32 storage_mask, 86 uint32 storage_mask,
82 const scoped_refptr<net::URLRequestContextGetter>& request_context, 87 const scoped_refptr<net::URLRequestContextGetter>& request_context,
83 const scoped_refptr<quota::QuotaManager>& quota_manager) { 88 const scoped_refptr<quota::QuotaManager>& quota_manager) {
84 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 89 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
85 90
86 if (storage_mask & StoragePartition::kCookies) { 91 if (storage_mask & StoragePartition::kCookies) {
87 // Handle the cookies. 92 // Handle the cookies.
88 net::CookieMonster* cookie_monster = 93 net::CookieMonster* cookie_monster =
89 request_context->GetURLRequestContext()->cookie_store()-> 94 request_context->GetURLRequestContext()->cookie_store()->
90 GetCookieMonster(); 95 GetCookieMonster();
91 if (cookie_monster) 96 if (cookie_monster)
92 cookie_monster->DeleteAllAsync(net::CookieMonster::DeleteCallback()); 97 cookie_monster->DeleteAllAsync(net::CookieMonster::DeleteCallback());
93 } 98 }
94 99
95 // Handle all HTML5 storage other than DOMStorageContext. 100 // Handle all HTML5 storage other than DOMStorageContext.
96 if (storage_mask & StoragePartition::kQuotaManagedTemporaryStorage) { 101 if (storage_mask & StoragePartition::kQuotaManagedTemporaryStorage) {
97 quota_manager->GetOriginsModifiedSince( 102 quota_manager->GetOriginsModifiedSince(
98 quota::kStorageTypeTemporary, base::Time(), 103 quota::kStorageTypeTemporary, base::Time(),
99 base::Bind(&ClearQuotaManagedOriginsOnIOThread, quota_manager)); 104 base::Bind(&ClearQuotaManagedOriginsOnIOThread, quota_manager));
100 } 105 }
101 if (storage_mask & StoragePartition::kQuotaManagedPersistentStorage) { 106 if (storage_mask & StoragePartition::kQuotaManagedPersistentStorage) {
102 quota_manager->GetOriginsModifiedSince( 107 quota_manager->GetOriginsModifiedSince(
103 quota::kStorageTypePersistent, base::Time(), 108 quota::kStorageTypePersistent, base::Time(),
104 base::Bind(&ClearQuotaManagedOriginsOnIOThread, quota_manager)); 109 base::Bind(&ClearQuotaManagedOriginsOnIOThread, quota_manager));
105 } 110 }
111 if (storage_mask & StoragePartition::kQuotaManagedSyncableStorage) {
112 quota_manager->GetOriginsModifiedSince(
113 quota::kStorageTypeSyncable, base::Time(),
114 base::Bind(&ClearQuotaManagedOriginsOnIOThread, quota_manager));
115 }
106 } 116 }
107 117
108 void ClearedShaderCacheOnIOThread(base::Closure callback) { 118 void ClearedShaderCacheOnIOThread(base::Closure callback) {
109 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 119 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
110 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback); 120 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback);
111 } 121 }
112 122
113 void ClearShaderCacheOnIOThread(base::FilePath path, 123 void ClearShaderCacheOnIOThread(base::FilePath path,
114 base::Time begin, base::Time end, base::Closure callback) { 124 base::Time begin, base::Time end, base::Closure callback) {
115 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 125 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 net::URLRequestContextGetter* url_request_context) { 335 net::URLRequestContextGetter* url_request_context) {
326 url_request_context_ = url_request_context; 336 url_request_context_ = url_request_context;
327 } 337 }
328 338
329 void StoragePartitionImpl::SetMediaURLRequestContext( 339 void StoragePartitionImpl::SetMediaURLRequestContext(
330 net::URLRequestContextGetter* media_url_request_context) { 340 net::URLRequestContextGetter* media_url_request_context) {
331 media_url_request_context_ = media_url_request_context; 341 media_url_request_context_ = media_url_request_context;
332 } 342 }
333 343
334 } // namespace content 344 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/quota_dispatcher_host.cc ('k') | content/public/browser/storage_partition.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698