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

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

Issue 2423883005: Remove FOR_EACH_OBSERVER macro usage in chrome/browser/android (Closed)
Patch Set: explicit types 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 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/cookies_tree_model.h" 5 #include "chrome/browser/browsing_data/cookies_tree_model.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <functional> 10 #include <functional>
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 } 1594 }
1595 } 1595 }
1596 1596
1597 void CookiesTreeModel::RecordBatchSeen() { 1597 void CookiesTreeModel::RecordBatchSeen() {
1598 batches_seen_++; 1598 batches_seen_++;
1599 } 1599 }
1600 1600
1601 void CookiesTreeModel::NotifyObserverBeginBatch() { 1601 void CookiesTreeModel::NotifyObserverBeginBatch() {
1602 // Only notify the model once if we're batching in a nested manner. 1602 // Only notify the model once if we're batching in a nested manner.
1603 if (batches_started_++ == 0) { 1603 if (batches_started_++ == 0) {
1604 FOR_EACH_OBSERVER(Observer, 1604 for (Observer& observer : cookies_observer_list_)
1605 cookies_observer_list_, 1605 observer.TreeModelBeginBatch(this);
1606 TreeModelBeginBatch(this));
1607 } 1606 }
1608 } 1607 }
1609 1608
1610 void CookiesTreeModel::NotifyObserverEndBatch() { 1609 void CookiesTreeModel::NotifyObserverEndBatch() {
1611 batches_ended_++; 1610 batches_ended_++;
1612 MaybeNotifyBatchesEnded(); 1611 MaybeNotifyBatchesEnded();
1613 } 1612 }
1614 1613
1615 void CookiesTreeModel::MaybeNotifyBatchesEnded() { 1614 void CookiesTreeModel::MaybeNotifyBatchesEnded() {
1616 // Only notify the observers if this is the outermost call to EndBatch() if 1615 // Only notify the observers if this is the outermost call to EndBatch() if
1617 // called in a nested manner. 1616 // called in a nested manner.
1618 if (batches_ended_ == batches_started_ && 1617 if (batches_ended_ == batches_started_ &&
1619 batches_seen_ == batches_expected_) { 1618 batches_seen_ == batches_expected_) {
1620 FOR_EACH_OBSERVER(Observer, 1619 for (Observer& observer : cookies_observer_list_)
1621 cookies_observer_list_, 1620 observer.TreeModelEndBatch(this);
1622 TreeModelEndBatch(this));
1623 SetBatchExpectation(0, true); 1621 SetBatchExpectation(0, true);
1624 } 1622 }
1625 } 1623 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698