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

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

Issue 1251243003: Support restricting browsing data removal for downloads by origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Remove unneeded DCHECK; Initialize and clear download URLs along test fixture life cycle. Created 5 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_remover.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/observer_list.h" 12 #include "base/observer_list.h"
13 #include "base/prefs/pref_member.h" 13 #include "base/prefs/pref_member.h"
14 #include "base/sequenced_task_runner_helpers.h" 14 #include "base/sequenced_task_runner_helpers.h"
15 #include "base/synchronization/waitable_event_watcher.h" 15 #include "base/synchronization/waitable_event_watcher.h"
16 #include "base/task/cancelable_task_tracker.h" 16 #include "base/task/cancelable_task_tracker.h"
17 #include "base/time/time.h" 17 #include "base/time/time.h"
18 #include "chrome/browser/pepper_flash_settings_manager.h" 18 #include "chrome/browser/pepper_flash_settings_manager.h"
19 #include "components/search_engines/template_url_service.h" 19 #include "components/search_engines/template_url_service.h"
20 #if defined(OS_CHROMEOS) 20 #if defined(OS_CHROMEOS)
21 #include "chromeos/dbus/dbus_method_call_status.h" 21 #include "chromeos/dbus/dbus_method_call_status.h"
22 #endif 22 #endif
23 #include "storage/common/quota/quota_types.h" 23 #include "storage/common/quota/quota_types.h"
24 #include "url/gurl.h" 24 #include "url/gurl.h"
25 #include "url/origin.h"
25 26
26 class IOThread; 27 class IOThread;
27 class Profile; 28 class Profile;
28 29
29 namespace chrome_browser_net { 30 namespace chrome_browser_net {
30 class Predictor; 31 class Predictor;
31 } 32 }
32 33
33 namespace content { 34 namespace content {
34 class PluginDataRemover; 35 class PluginDataRemover;
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 void OnDeauthorizeContentLicensesCompleted(uint32 request_id, 265 void OnDeauthorizeContentLicensesCompleted(uint32 request_id,
265 bool success) override; 266 bool success) override;
266 #endif 267 #endif
267 268
268 #if defined (OS_CHROMEOS) 269 #if defined (OS_CHROMEOS)
269 void OnClearPlatformKeys(chromeos::DBusMethodCallStatus call_status, 270 void OnClearPlatformKeys(chromeos::DBusMethodCallStatus call_status,
270 bool result); 271 bool result);
271 #endif 272 #endif
272 273
273 // Removes the specified items related to browsing for a specific host. If the 274 // Removes the specified items related to browsing for a specific host. If the
274 // provided |origin| is empty, data is removed for all origins. The 275 // provided |remove_url| is empty, data is removed for all origins. The
275 // |origin_type_mask| parameter defines the set of origins from which data 276 // |origin_type_mask| parameter defines the set of origins from which data
276 // should be removed (protected, unprotected, or both). 277 // should be removed (protected, unprotected, or both).
278 // TODO(mkwst): The current implementation relies on unique (empty) origins to
279 // signal removal of all origins. Reconsider this behavior if/when we build
280 // a "forget this site" feature.
277 void RemoveImpl(int remove_mask, 281 void RemoveImpl(int remove_mask,
278 const GURL& origin, 282 const GURL& remove_url,
279 int origin_type_mask); 283 int origin_type_mask);
280 284
281 // Notifies observers and deletes this object. 285 // Notifies observers and deletes this object.
282 void NotifyAndDelete(); 286 void NotifyAndDelete();
283 287
284 // Checks if we are all done, and if so, calls NotifyAndDelete(). 288 // Checks if we are all done, and if so, calls NotifyAndDelete().
285 void NotifyAndDeleteIfDone(); 289 void NotifyAndDeleteIfDone();
286 290
287 // Callback for when the hostname resolution cache has been cleared. 291 // Callback for when the hostname resolution cache has been cleared.
288 // Clears the respective waiting flag and invokes NotifyAndDeleteIfDone. 292 // Clears the respective waiting flag and invokes NotifyAndDeleteIfDone.
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 bool waiting_for_clear_precache_history_; 436 bool waiting_for_clear_precache_history_;
433 #endif 437 #endif
434 bool waiting_for_clear_storage_partition_data_; 438 bool waiting_for_clear_storage_partition_data_;
435 #if defined(ENABLE_WEBRTC) 439 #if defined(ENABLE_WEBRTC)
436 bool waiting_for_clear_webrtc_logs_; 440 bool waiting_for_clear_webrtc_logs_;
437 #endif 441 #endif
438 442
439 // The removal mask for the current removal operation. 443 // The removal mask for the current removal operation.
440 int remove_mask_; 444 int remove_mask_;
441 445
442 // The origin for the current removal operation.
443 GURL remove_origin_;
444
445 // From which types of origins should we remove data? 446 // From which types of origins should we remove data?
446 int origin_type_mask_; 447 int origin_type_mask_;
447 448
448 base::ObserverList<Observer> observer_list_; 449 base::ObserverList<Observer> observer_list_;
449 450
450 // Used if we need to clear history. 451 // Used if we need to clear history.
451 base::CancelableTaskTracker history_task_tracker_; 452 base::CancelableTaskTracker history_task_tracker_;
452 453
453 scoped_ptr<TemplateURLService::Subscription> template_url_sub_; 454 scoped_ptr<TemplateURLService::Subscription> template_url_sub_;
454 455
455 // We do not own this. 456 // We do not own this.
456 content::StoragePartition* storage_partition_for_testing_; 457 content::StoragePartition* storage_partition_for_testing_;
457 458
458 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover); 459 DISALLOW_COPY_AND_ASSIGN(BrowsingDataRemover);
459 }; 460 };
460 461
461 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_ 462 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_remover.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698