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

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

Issue 1402783005: Remove safe_browsing=2 functionality, replace with =3 mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix up histograms Created 5 years, 2 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
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 "chrome/browser/browsing_data/browsing_data_remover.h" 5 #include "chrome/browser/browsing_data/browsing_data_remover.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 // don't accidentally remove the cookies that are associated with the 480 // don't accidentally remove the cookies that are associated with the
481 // UNPROTECTED_WEB origin. This is necessary because cookies are not separated 481 // UNPROTECTED_WEB origin. This is necessary because cookies are not separated
482 // between UNPROTECTED_WEB and PROTECTED_WEB. 482 // between UNPROTECTED_WEB and PROTECTED_WEB.
483 if (remove_mask & REMOVE_COOKIES && 483 if (remove_mask & REMOVE_COOKIES &&
484 origin_type_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) { 484 origin_type_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) {
485 content::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); 485 content::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies"));
486 486
487 storage_partition_remove_mask |= 487 storage_partition_remove_mask |=
488 content::StoragePartition::REMOVE_DATA_MASK_COOKIES; 488 content::StoragePartition::REMOVE_DATA_MASK_COOKIES;
489 489
490 #if defined(SAFE_BROWSING_SERVICE)
491 // Clear the safebrowsing cookies only if time period is for "all time". It 490 // Clear the safebrowsing cookies only if time period is for "all time". It
492 // doesn't make sense to apply the time period of deleting in the last X 491 // doesn't make sense to apply the time period of deleting in the last X
493 // hours/days to the safebrowsing cookies since they aren't the result of 492 // hours/days to the safebrowsing cookies since they aren't the result of
494 // any user action. 493 // any user action.
495 if (delete_begin_ == base::Time()) { 494 if (delete_begin_ == base::Time()) {
496 SafeBrowsingService* sb_service = 495 SafeBrowsingService* sb_service =
497 g_browser_process->safe_browsing_service(); 496 g_browser_process->safe_browsing_service();
498 if (sb_service) { 497 if (sb_service) {
499 net::URLRequestContextGetter* sb_context = 498 net::URLRequestContextGetter* sb_context =
500 sb_service->url_request_context(); 499 sb_service->url_request_context();
501 ++waiting_for_clear_cookies_count_; 500 ++waiting_for_clear_cookies_count_;
502 BrowserThread::PostTask( 501 BrowserThread::PostTask(
503 BrowserThread::IO, FROM_HERE, 502 BrowserThread::IO, FROM_HERE,
504 base::Bind(&BrowsingDataRemover::ClearCookiesOnIOThread, 503 base::Bind(&BrowsingDataRemover::ClearCookiesOnIOThread,
505 base::Unretained(this), base::Unretained(sb_context))); 504 base::Unretained(this), base::Unretained(sb_context)));
506 } 505 }
507 } 506 }
508 #endif 507
509 MediaDeviceIDSalt::Reset(profile_->GetPrefs()); 508 MediaDeviceIDSalt::Reset(profile_->GetPrefs());
510 509
511 // TODO(mkwst): If we're not removing passwords, then clear the 'zero-click' 510 // TODO(mkwst): If we're not removing passwords, then clear the 'zero-click'
512 // flag for all credentials in the password store. 511 // flag for all credentials in the password store.
513 } 512 }
514 513
515 // Channel IDs are not separated for protected and unprotected web 514 // Channel IDs are not separated for protected and unprotected web
516 // origins. We check the origin_type_mask_ to prevent unintended deletion. 515 // origins. We check the origin_type_mask_ to prevent unintended deletion.
517 if (remove_mask & REMOVE_CHANNEL_IDS && 516 if (remove_mask & REMOVE_CHANNEL_IDS &&
518 origin_type_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) { 517 origin_type_mask_ & BrowsingDataHelper::UNPROTECTED_WEB) {
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 waiting_for_clear_domain_reliability_monitor_ = false; 1176 waiting_for_clear_domain_reliability_monitor_ = false;
1178 NotifyAndDeleteIfDone(); 1177 NotifyAndDeleteIfDone();
1179 } 1178 }
1180 1179
1181 // static 1180 // static
1182 BrowsingDataRemover::CallbackSubscription 1181 BrowsingDataRemover::CallbackSubscription
1183 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( 1182 BrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback(
1184 const BrowsingDataRemover::Callback& callback) { 1183 const BrowsingDataRemover::Callback& callback) {
1185 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); 1184 return GetOnBrowsingDataRemovedCallbacks()->Add(callback);
1186 } 1185 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/browsing_data/browsing_data_remover_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698