Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 283 const std::string& flash_lso_domain) { | 283 const std::string& flash_lso_domain) { |
| 284 Init(TYPE_FLASH_LSO); | 284 Init(TYPE_FLASH_LSO); |
| 285 this->flash_lso_domain = flash_lso_domain; | 285 this->flash_lso_domain = flash_lso_domain; |
| 286 return *this; | 286 return *this; |
| 287 } | 287 } |
| 288 | 288 |
| 289 /////////////////////////////////////////////////////////////////////////////// | 289 /////////////////////////////////////////////////////////////////////////////// |
| 290 // CookieTreeNode, public: | 290 // CookieTreeNode, public: |
| 291 | 291 |
| 292 void CookieTreeNode::DeleteStoredObjects() { | 292 void CookieTreeNode::DeleteStoredObjects() { |
| 293 std::for_each(children().begin(), | 293 for (auto* child : children()) |
| 294 children().end(), | 294 child->DeleteStoredObjects(); |
|
Nico
2016/03/10 22:23:18
\o/
| |
| 295 std::mem_fun(&CookieTreeNode::DeleteStoredObjects)); | |
| 296 } | 295 } |
| 297 | 296 |
| 298 CookiesTreeModel* CookieTreeNode::GetModel() const { | 297 CookiesTreeModel* CookieTreeNode::GetModel() const { |
| 299 if (parent()) | 298 if (parent()) |
| 300 return parent()->GetModel(); | 299 return parent()->GetModel(); |
| 301 return nullptr; | 300 return nullptr; |
| 302 } | 301 } |
| 303 | 302 |
| 304 /////////////////////////////////////////////////////////////////////////////// | 303 /////////////////////////////////////////////////////////////////////////////// |
| 305 // CookieTreeCookieNode, public: | 304 // CookieTreeCookieNode, public: |
| (...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1548 void CookiesTreeModel::MaybeNotifyBatchesEnded() { | 1547 void CookiesTreeModel::MaybeNotifyBatchesEnded() { |
| 1549 // Only notify the observers if this is the outermost call to EndBatch() if | 1548 // Only notify the observers if this is the outermost call to EndBatch() if |
| 1550 // called in a nested manner. | 1549 // called in a nested manner. |
| 1551 if (batches_ended_ == batches_started_ && | 1550 if (batches_ended_ == batches_started_ && |
| 1552 batches_seen_ == batches_expected_) { | 1551 batches_seen_ == batches_expected_) { |
| 1553 FOR_EACH_OBSERVER(Observer, | 1552 FOR_EACH_OBSERVER(Observer, |
| 1554 cookies_observer_list_, | 1553 cookies_observer_list_, |
| 1555 TreeModelEndBatch(this)); | 1554 TreeModelEndBatch(this)); |
| 1556 } | 1555 } |
| 1557 } | 1556 } |
| OLD | NEW |