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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover.h

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, 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 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_
6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 REMOVE_FORM_DATA = 1 << 5, 75 REMOVE_FORM_DATA = 1 << 5,
76 // In addition to visits, REMOVE_HISTORY removes keywords and last session. 76 // In addition to visits, REMOVE_HISTORY removes keywords and last session.
77 REMOVE_HISTORY = 1 << 6, 77 REMOVE_HISTORY = 1 << 6,
78 REMOVE_INDEXEDDB = 1 << 7, 78 REMOVE_INDEXEDDB = 1 << 7,
79 REMOVE_LOCAL_STORAGE = 1 << 8, 79 REMOVE_LOCAL_STORAGE = 1 << 8,
80 REMOVE_PLUGIN_DATA = 1 << 9, 80 REMOVE_PLUGIN_DATA = 1 << 9,
81 REMOVE_PASSWORDS = 1 << 10, 81 REMOVE_PASSWORDS = 1 << 10,
82 REMOVE_WEBSQL = 1 << 11, 82 REMOVE_WEBSQL = 1 << 11,
83 REMOVE_SERVER_BOUND_CERTS = 1 << 12, 83 REMOVE_SERVER_BOUND_CERTS = 1 << 12,
84 REMOVE_CONTENT_LICENSES = 1 << 13, 84 REMOVE_CONTENT_LICENSES = 1 << 13,
85 REMOVE_SHADER_CACHE = 1 << 14,
85 // The following flag is used only in tests. In normal usage, hosted app 86 // The following flag is used only in tests. In normal usage, hosted app
86 // data is controlled by the REMOVE_COOKIES flag, applied to the 87 // data is controlled by the REMOVE_COOKIES flag, applied to the
87 // protected-web origin. 88 // protected-web origin.
88 REMOVE_HOSTED_APP_DATA_TESTONLY = 1 << 31, 89 REMOVE_HOSTED_APP_DATA_TESTONLY = 1 << 31,
89 90
90 // "Site data" includes cookies, appcache, file systems, indexedDBs, local 91 // "Site data" includes cookies, appcache, file systems, indexedDBs, local
91 // storage, webSQL, and plugin data. 92 // storage, webSQL, shader, and plugin data.
92 REMOVE_SITE_DATA = REMOVE_APPCACHE | REMOVE_COOKIES | REMOVE_FILE_SYSTEMS | 93 REMOVE_SITE_DATA = REMOVE_APPCACHE | REMOVE_COOKIES | REMOVE_FILE_SYSTEMS |
93 REMOVE_INDEXEDDB | REMOVE_LOCAL_STORAGE | 94 REMOVE_INDEXEDDB | REMOVE_LOCAL_STORAGE |
94 REMOVE_PLUGIN_DATA | REMOVE_WEBSQL | 95 REMOVE_PLUGIN_DATA | REMOVE_WEBSQL |
95 REMOVE_SERVER_BOUND_CERTS 96 REMOVE_SERVER_BOUND_CERTS,
97 // "cached data" includes the http cache and the shader cache.
98 REMOVE_CACHED_DATA = REMOVE_CACHE | REMOVE_SHADER_CACHE
96 }; 99 };
97 100
98 // When BrowsingDataRemover successfully removes data, a notification of type 101 // When BrowsingDataRemover successfully removes data, a notification of type
99 // NOTIFICATION_BROWSING_DATA_REMOVED is triggered with a Details object of 102 // NOTIFICATION_BROWSING_DATA_REMOVED is triggered with a Details object of
100 // this type. 103 // this type.
101 struct NotificationDetails { 104 struct NotificationDetails {
102 NotificationDetails(); 105 NotificationDetails();
103 NotificationDetails(const NotificationDetails& details); 106 NotificationDetails(const NotificationDetails& details);
104 NotificationDetails(base::Time removal_begin, 107 NotificationDetails(base::Time removal_begin,
105 int removal_mask, 108 int removal_mask,
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 // NotifyAndDeleteIfDone. 335 // NotifyAndDeleteIfDone.
333 void OnClearedServerBoundCerts(); 336 void OnClearedServerBoundCerts();
334 337
335 // Callback on the DB thread so that we can wait for the form data to be 338 // Callback on the DB thread so that we can wait for the form data to be
336 // cleared. 339 // cleared.
337 void FormDataDBThreadHop(); 340 void FormDataDBThreadHop();
338 341
339 // Callback from the above method. 342 // Callback from the above method.
340 void OnClearedFormData(); 343 void OnClearedFormData();
341 344
345 // Callback when the shader cache has been deleted.
346 // Invokes NotifyAndDeleteIfDone.
347 void ClearedShaderCache();
348
349 // Invoked on the IO thread to delete from the shader cache.
350 void ClearShaderCacheOnUIThread();
351
342 // Returns true if we're all done. 352 // Returns true if we're all done.
343 bool AllDone(); 353 bool AllDone();
344 354
345 content::NotificationRegistrar registrar_; 355 content::NotificationRegistrar registrar_;
346 356
347 // Profile we're to remove from. 357 // Profile we're to remove from.
348 Profile* profile_; 358 Profile* profile_;
349 359
350 // The QuotaManager is owned by the profile; we can use a raw pointer here, 360 // The QuotaManager is owned by the profile; we can use a raw pointer here,
351 // and rely on the profile to destroy the object whenever it's reasonable. 361 // and rely on the profile to destroy the object whenever it's reasonable.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 bool waiting_for_clear_history_; 403 bool waiting_for_clear_history_;
394 bool waiting_for_clear_hostname_resolution_cache_; 404 bool waiting_for_clear_hostname_resolution_cache_;
395 bool waiting_for_clear_local_storage_; 405 bool waiting_for_clear_local_storage_;
396 bool waiting_for_clear_nacl_cache_; 406 bool waiting_for_clear_nacl_cache_;
397 bool waiting_for_clear_network_predictor_; 407 bool waiting_for_clear_network_predictor_;
398 bool waiting_for_clear_networking_history_; 408 bool waiting_for_clear_networking_history_;
399 bool waiting_for_clear_plugin_data_; 409 bool waiting_for_clear_plugin_data_;
400 bool waiting_for_clear_quota_managed_data_; 410 bool waiting_for_clear_quota_managed_data_;
401 bool waiting_for_clear_server_bound_certs_; 411 bool waiting_for_clear_server_bound_certs_;
402 bool waiting_for_clear_session_storage_; 412 bool waiting_for_clear_session_storage_;
413 bool waiting_for_clear_shader_cache_;
403 414
404 // Tracking how many origins need to be deleted, and whether we're finished 415 // Tracking how many origins need to be deleted, and whether we're finished
405 // gathering origins. 416 // gathering origins.
406 int quota_managed_origins_to_delete_count_; 417 int quota_managed_origins_to_delete_count_;
407 int quota_managed_storage_types_to_delete_count_; 418 int quota_managed_storage_types_to_delete_count_;
408 419
409 // The removal mask for the current removal operation. 420 // The removal mask for the current removal operation.
410 int remove_mask_; 421 int remove_mask_;
411 422
412 // The origin for the current removal operation. 423 // The origin for the current removal operation.
413 GURL remove_origin_; 424 GURL remove_origin_;
414 425
415 // From which types of origins should we remove data? 426 // From which types of origins should we remove data?
416 int origin_set_mask_; 427 int origin_set_mask_;
417 428
418 ObserverList<Observer> observer_list_; 429 ObserverList<Observer> observer_list_;
419 430
420 // Used if we need to clear history. 431 // Used if we need to clear history.
421 CancelableTaskTracker history_task_tracker_; 432 CancelableTaskTracker history_task_tracker_;
422 433
423 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); 434 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover);
424 }; 435 };
425 436
426 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ 437 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698