Chromium Code Reviews| Index: chrome/browser/managed_mode/managed_mode_url_filter.cc |
| diff --git a/chrome/browser/managed_mode/managed_mode_url_filter.cc b/chrome/browser/managed_mode/managed_mode_url_filter.cc |
| index 321eebe65b14b863aba5ebe3c8e848dfcc705f58..8b2ff4543f576093a460c6409c117d332d13b069 100644 |
| --- a/chrome/browser/managed_mode/managed_mode_url_filter.cc |
| +++ b/chrome/browser/managed_mode/managed_mode_url_filter.cc |
| @@ -157,15 +157,14 @@ scoped_ptr<ManagedModeURLFilter::Contents> LoadWhitelistsOnBlockingPoolThread( |
| } // namespace |
| ManagedModeURLFilter::ManagedModeURLFilter() |
| - : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)), |
| - default_behavior_(ALLOW), |
| + : default_behavior_(ALLOW), |
| contents_(new Contents()), |
| url_manual_list_allow_(new policy::URLBlacklist()), |
| url_manual_list_block_(new policy::URLBlacklist()) { |
| // Set empty manual lists in the begining. |
| - scoped_ptr<base::ListValue> whitelist(new base::ListValue()); |
| - scoped_ptr<base::ListValue> blacklist(new base::ListValue()); |
| - SetManualLists(whitelist.Pass(), blacklist.Pass()); |
| + base::ListValue whitelist; |
|
Pam (message me for reviews)
2013/01/14 14:12:42
Is this cleanup actually related to the rest of th
Bernhard Bauer
2013/01/15 14:24:44
Well, I'm changing the interface to SetManualLists
|
| + base::ListValue blacklist; |
| + SetManualLists(&whitelist, &blacklist); |
| // Detach from the current thread so we can be constructed on a different |
| // thread than the one where we're used. |
| DetachFromThread(); |
| @@ -264,7 +263,7 @@ void ManagedModeURLFilter::LoadWhitelists( |
| base::Bind(&LoadWhitelistsOnBlockingPoolThread, |
| base::Passed(&site_lists)), |
| base::Bind(&ManagedModeURLFilter::SetContents, |
| - weak_ptr_factory_.GetWeakPtr(), continuation)); |
| + this, continuation)); |
| } |
| void ManagedModeURLFilter::SetFromPatterns( |
| @@ -277,30 +276,30 @@ void ManagedModeURLFilter::SetFromPatterns( |
| FROM_HERE, |
| base::Bind(&CreateWhitelistFromPatterns, patterns), |
| base::Bind(&ManagedModeURLFilter::SetContents, |
| - weak_ptr_factory_.GetWeakPtr(), continuation)); |
| + this, continuation)); |
| } |
| -void ManagedModeURLFilter::SetManualLists(scoped_ptr<ListValue> whitelist, |
| - scoped_ptr<ListValue> blacklist){ |
| +void ManagedModeURLFilter::SetManualLists(const ListValue* whitelist, |
| + const ListValue* blacklist) { |
| DCHECK(CalledOnValidThread()); |
| url_manual_list_block_.reset(new policy::URLBlacklist); |
| url_manual_list_allow_.reset(new policy::URLBlacklist); |
| - url_manual_list_block_->Block(blacklist.get()); |
| + url_manual_list_block_->Block(blacklist); |
| ListValue all_sites; |
| all_sites.Append(new base::StringValue("*")); |
| - url_manual_list_allow_->Allow(whitelist.get()); |
| + url_manual_list_allow_->Allow(whitelist); |
| url_manual_list_allow_->Block(&all_sites); |
| // Debug |
| DVLOG(1) << "Loaded whitelist: "; |
| - for (ListValue::iterator it = whitelist->begin(); |
| + for (ListValue::const_iterator it = whitelist->begin(); |
| it != whitelist->end(); ++it){ |
| std::string item; |
| (*it)->GetAsString(&item); |
| DVLOG(1) << item; |
| } |
| DVLOG(1) << "Loaded blacklist: "; |
| - for (ListValue::iterator it = blacklist->begin(); |
| + for (ListValue::const_iterator it = blacklist->begin(); |
| it != blacklist->end(); ++it){ |
| std::string item; |
| (*it)->GetAsString(&item); |