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

Side by Side Diff: chrome/browser/supervised_user/supervised_user_service.cc

Issue 2858073002: Use constexpr TaskTraits constructor in chrome. (Closed)
Patch Set: Created 3 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/supervised_user/supervised_user_service.h" 5 #include "chrome/browser/supervised_user/supervised_user_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 whitelists_ = site_lists; 748 whitelists_ = site_lists;
749 url_filter_.LoadWhitelists(site_lists); 749 url_filter_.LoadWhitelists(site_lists);
750 } 750 }
751 751
752 void SupervisedUserService::LoadBlacklist(const base::FilePath& path, 752 void SupervisedUserService::LoadBlacklist(const base::FilePath& path,
753 const GURL& url) { 753 const GURL& url) {
754 DCHECK(blacklist_state_ == BlacklistLoadState::NOT_LOADED); 754 DCHECK(blacklist_state_ == BlacklistLoadState::NOT_LOADED);
755 blacklist_state_ = BlacklistLoadState::LOAD_STARTED; 755 blacklist_state_ = BlacklistLoadState::LOAD_STARTED;
756 base::PostTaskWithTraitsAndReplyWithResult( 756 base::PostTaskWithTraitsAndReplyWithResult(
757 FROM_HERE, 757 FROM_HERE,
758 base::TaskTraits() 758 {base::MayBlock(), base::TaskPriority::BACKGROUND,
759 .MayBlock() 759 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
760 .WithPriority(base::TaskPriority::BACKGROUND)
761 .WithShutdownBehavior(
762 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN),
763 base::BindOnce(&base::PathExists, path), 760 base::BindOnce(&base::PathExists, path),
764 base::BindOnce(&SupervisedUserService::OnBlacklistFileChecked, 761 base::BindOnce(&SupervisedUserService::OnBlacklistFileChecked,
765 weak_ptr_factory_.GetWeakPtr(), path, url)); 762 weak_ptr_factory_.GetWeakPtr(), path, url));
766 } 763 }
767 764
768 void SupervisedUserService::OnBlacklistFileChecked(const base::FilePath& path, 765 void SupervisedUserService::OnBlacklistFileChecked(const base::FilePath& path,
769 const GURL& url, 766 const GURL& url,
770 bool file_exists) { 767 bool file_exists) {
771 DCHECK(blacklist_state_ == BlacklistLoadState::LOAD_STARTED); 768 DCHECK(blacklist_state_ == BlacklistLoadState::LOAD_STARTED);
772 if (file_exists) { 769 if (file_exists) {
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 base::RecordAction(UserMetricsAction("ManagedUsers_SwitchProfile")); 1207 base::RecordAction(UserMetricsAction("ManagedUsers_SwitchProfile"));
1211 1208
1212 is_profile_active_ = profile_became_active; 1209 is_profile_active_ = profile_became_active;
1213 } 1210 }
1214 #endif // !defined(OS_ANDROID) 1211 #endif // !defined(OS_ANDROID)
1215 1212
1216 void SupervisedUserService::OnSiteListUpdated() { 1213 void SupervisedUserService::OnSiteListUpdated() {
1217 for (SupervisedUserServiceObserver& observer : observer_list_) 1214 for (SupervisedUserServiceObserver& observer : observer_list_)
1218 observer.OnURLFilterChanged(); 1215 observer.OnURLFilterChanged();
1219 } 1216 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698