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

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

Issue 2379863002: Fix object ownership in ui/base/models. (Closed)
Patch Set: fix 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 <string> 7 #include <string>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 std::string GetDisplayedFlashLSOs(CookiesTreeModel* cookies_model) { 415 std::string GetDisplayedFlashLSOs(CookiesTreeModel* cookies_model) {
416 return GetDisplayedNodes( 416 return GetDisplayedNodes(
417 cookies_model, CookieTreeNode::DetailedInfo::TYPE_FLASH_LSO); 417 cookies_model, CookieTreeNode::DetailedInfo::TYPE_FLASH_LSO);
418 } 418 }
419 419
420 // Do not call on the root. 420 // Do not call on the root.
421 void DeleteStoredObjects(CookieTreeNode* node) { 421 void DeleteStoredObjects(CookieTreeNode* node) {
422 node->DeleteStoredObjects(); 422 node->DeleteStoredObjects();
423 CookieTreeNode* parent_node = node->parent(); 423 CookieTreeNode* parent_node = node->parent();
424 DCHECK(parent_node); 424 DCHECK(parent_node);
425 delete parent_node->GetModel()->Remove(parent_node, node); 425 parent_node->GetModel()->Remove(parent_node, node);
426 } 426 }
427 427
428 protected: 428 protected:
429 ExtensionSpecialStoragePolicy* special_storage_policy() { 429 ExtensionSpecialStoragePolicy* special_storage_policy() {
430 #if defined(ENABLE_EXTENSIONS) 430 #if defined(ENABLE_EXTENSIONS)
431 return special_storage_policy_.get(); 431 return special_storage_policy_.get();
432 #else 432 #else
433 return nullptr; 433 return nullptr;
434 #endif 434 #endif
435 } 435 }
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 mock_browsing_data_flash_lso_helper_.get()); 1647 mock_browsing_data_flash_lso_helper_.get());
1648 CookiesTreeModel cookies_model(container, special_storage_policy()); 1648 CookiesTreeModel cookies_model(container, special_storage_policy());
1649 1649
1650 mock_browsing_data_cookie_helper_-> 1650 mock_browsing_data_cookie_helper_->
1651 AddCookieSamples(GURL(), "A=1"); 1651 AddCookieSamples(GURL(), "A=1");
1652 mock_browsing_data_cookie_helper_->Notify(); 1652 mock_browsing_data_cookie_helper_->Notify();
1653 EXPECT_EQ("A", GetDisplayedCookies(&cookies_model)); 1653 EXPECT_EQ("A", GetDisplayedCookies(&cookies_model));
1654 } 1654 }
1655 1655
1656 } // namespace 1656 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data/cookies_tree_model.cc ('k') | chrome/browser/ui/views/bookmarks/bookmark_editor_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698