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

Unified Diff: ios/web/web_state/web_state_impl.mm

Issue 2419673003: Remove base::ObserverList<T>::Iter::GetNext(). (Closed)
Patch Set: ios fix too Created 4 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 side-by-side diff with in-line comments
Download patch
Index: ios/web/web_state/web_state_impl.mm
diff --git a/ios/web/web_state/web_state_impl.mm b/ios/web/web_state/web_state_impl.mm
index 1830c3c82bcbdff1f93e4316ae0fd9920471efde..4fdef649b901515de335d99143b51ac392ce1b41 100644
--- a/ios/web/web_state/web_state_impl.mm
+++ b/ios/web/web_state/web_state_impl.mm
@@ -475,20 +475,16 @@ void WebStateImpl::SetContentsMimeType(const std::string& mime_type) {
}
bool WebStateImpl::ShouldAllowRequest(NSURLRequest* request) {
- base::ObserverListBase<WebStatePolicyDecider>::Iterator it(&policy_deciders_);
- WebStatePolicyDecider* policy_decider = nullptr;
- while ((policy_decider = it.GetNext()) != nullptr) {
- if (!policy_decider->ShouldAllowRequest(request))
+ for (auto& policy_decider : policy_deciders_) {
+ if (!policy_decider.ShouldAllowRequest(request))
return false;
}
return true;
}
bool WebStateImpl::ShouldAllowResponse(NSURLResponse* response) {
- base::ObserverListBase<WebStatePolicyDecider>::Iterator it(&policy_deciders_);
- WebStatePolicyDecider* policy_decider = nullptr;
- while ((policy_decider = it.GetNext()) != nullptr) {
- if (!policy_decider->ShouldAllowResponse(response))
+ for (auto& policy_decider : policy_deciders_) {
+ if (!policy_decider.ShouldAllowResponse(response))
return false;
}
return true;

Powered by Google App Engine
This is Rietveld 408576698