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

Side by Side Diff: chrome/browser/cookies_tree_model.h

Issue 7355025: Creat BrowsingDataCookieHelper and CannedBrowsingDataCookieHelper for logging cookies at UI thread. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_COOKIES_TREE_MODEL_H_ 5 #ifndef CHROME_BROWSER_COOKIES_TREE_MODEL_H_
6 #define CHROME_BROWSER_COOKIES_TREE_MODEL_H_ 6 #define CHROME_BROWSER_COOKIES_TREE_MODEL_H_
7 #pragma once 7 #pragma once
8 8
9 // TODO(viettrungluu): This header file #includes far too much and has too much 9 // TODO(viettrungluu): This header file #includes far too much and has too much
10 // inline code (which shouldn't be inline). 10 // inline code (which shouldn't be inline).
11 11
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/observer_list.h" 16 #include "base/observer_list.h"
17 #include "base/string16.h" 17 #include "base/string16.h"
18 #include "base/utf_string_conversions.h" 18 #include "base/utf_string_conversions.h"
19 #include "chrome/browser/browsing_data_appcache_helper.h" 19 #include "chrome/browser/browsing_data_appcache_helper.h"
20 #include "chrome/browser/browsing_data_database_helper.h" 20 #include "chrome/browser/browsing_data_database_helper.h"
21 #include "chrome/browser/browsing_data_file_system_helper.h" 21 #include "chrome/browser/browsing_data_file_system_helper.h"
22 #include "chrome/browser/browsing_data_indexed_db_helper.h" 22 #include "chrome/browser/browsing_data_indexed_db_helper.h"
23 #include "chrome/browser/browsing_data_local_storage_helper.h" 23 #include "chrome/browser/browsing_data_local_storage_helper.h"
24 #include "chrome/common/content_settings.h" 24 #include "chrome/common/content_settings.h"
25 #include "net/base/cookie_monster.h" 25 #include "net/base/cookie_monster.h"
26 #include "ui/base/models/tree_node_model.h" 26 #include "ui/base/models/tree_node_model.h"
27 27
28 class BrowsingDataCookieHelper;
28 class CookiesTreeModel; 29 class CookiesTreeModel;
29 class CookieTreeAppCacheNode; 30 class CookieTreeAppCacheNode;
30 class CookieTreeAppCachesNode; 31 class CookieTreeAppCachesNode;
31 class CookieTreeCookieNode; 32 class CookieTreeCookieNode;
32 class CookieTreeCookiesNode; 33 class CookieTreeCookiesNode;
33 class CookieTreeDatabaseNode; 34 class CookieTreeDatabaseNode;
34 class CookieTreeDatabasesNode; 35 class CookieTreeDatabasesNode;
35 class CookieTreeFileSystemsNode; 36 class CookieTreeFileSystemsNode;
36 class CookieTreeFileSystemNode; 37 class CookieTreeFileSystemNode;
37 class CookieTreeLocalStorageNode; 38 class CookieTreeLocalStorageNode;
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 // observers for every item added from databases, local storage, and 508 // observers for every item added from databases, local storage, and
508 // appcache. We extend the Observer interface to add notifications before and 509 // appcache. We extend the Observer interface to add notifications before and
509 // after these batch inserts. 510 // after these batch inserts.
510 class Observer : public ui::TreeModelObserver { 511 class Observer : public ui::TreeModelObserver {
511 public: 512 public:
512 virtual void TreeModelBeginBatch(CookiesTreeModel* model) {} 513 virtual void TreeModelBeginBatch(CookiesTreeModel* model) {}
513 virtual void TreeModelEndBatch(CookiesTreeModel* model) {} 514 virtual void TreeModelEndBatch(CookiesTreeModel* model) {}
514 }; 515 };
515 516
516 CookiesTreeModel( 517 CookiesTreeModel(
517 net::CookieMonster* cookie_monster_, 518 BrowsingDataCookieHelper* cookie_helper,
518 BrowsingDataDatabaseHelper* database_helper, 519 BrowsingDataDatabaseHelper* database_helper,
519 BrowsingDataLocalStorageHelper* local_storage_helper, 520 BrowsingDataLocalStorageHelper* local_storage_helper,
520 BrowsingDataLocalStorageHelper* session_storage_helper, 521 BrowsingDataLocalStorageHelper* session_storage_helper,
521 BrowsingDataAppCacheHelper* appcache_helper, 522 BrowsingDataAppCacheHelper* appcache_helper,
522 BrowsingDataIndexedDBHelper* indexed_db_helper, 523 BrowsingDataIndexedDBHelper* indexed_db_helper,
523 BrowsingDataFileSystemHelper* file_system_helper, 524 BrowsingDataFileSystemHelper* file_system_helper,
524 bool use_cookie_source); 525 bool use_cookie_source);
525 virtual ~CookiesTreeModel(); 526 virtual ~CookiesTreeModel();
526 527
527 // ui::TreeModel methods: 528 // ui::TreeModel methods:
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 DatabaseInfoList; 560 DatabaseInfoList;
560 typedef std::vector<BrowsingDataLocalStorageHelper::LocalStorageInfo> 561 typedef std::vector<BrowsingDataLocalStorageHelper::LocalStorageInfo>
561 LocalStorageInfoList; 562 LocalStorageInfoList;
562 typedef std::vector<BrowsingDataLocalStorageHelper::LocalStorageInfo> 563 typedef std::vector<BrowsingDataLocalStorageHelper::LocalStorageInfo>
563 SessionStorageInfoList; 564 SessionStorageInfoList;
564 typedef std::vector<BrowsingDataIndexedDBHelper::IndexedDBInfo> 565 typedef std::vector<BrowsingDataIndexedDBHelper::IndexedDBInfo>
565 IndexedDBInfoList; 566 IndexedDBInfoList;
566 typedef std::vector<BrowsingDataFileSystemHelper::FileSystemInfo> 567 typedef std::vector<BrowsingDataFileSystemHelper::FileSystemInfo>
567 FileSystemInfoList; 568 FileSystemInfoList;
568 569
569 void LoadCookies();
570 void LoadCookiesWithFilter(const std::wstring& filter);
571
572 void OnAppCacheModelInfoLoaded(); 570 void OnAppCacheModelInfoLoaded();
571 void OnCookiesModelInfoLoaded(const CookieList& cookie_list);
573 void OnDatabaseModelInfoLoaded(const DatabaseInfoList& database_info); 572 void OnDatabaseModelInfoLoaded(const DatabaseInfoList& database_info);
574 void OnLocalStorageModelInfoLoaded( 573 void OnLocalStorageModelInfoLoaded(
575 const LocalStorageInfoList& local_storage_info); 574 const LocalStorageInfoList& local_storage_info);
576 void OnSessionStorageModelInfoLoaded( 575 void OnSessionStorageModelInfoLoaded(
577 const LocalStorageInfoList& local_storage_info); 576 const LocalStorageInfoList& local_storage_info);
578 void OnIndexedDBModelInfoLoaded( 577 void OnIndexedDBModelInfoLoaded(
579 const IndexedDBInfoList& indexed_db_info); 578 const IndexedDBInfoList& indexed_db_info);
580 void OnFileSystemModelInfoLoaded( 579 void OnFileSystemModelInfoLoaded(
581 const FileSystemInfoList& file_system_info); 580 const FileSystemInfoList& file_system_info);
582 581
583 void PopulateAppCacheInfoWithFilter(const std::wstring& filter); 582 void PopulateAppCacheInfoWithFilter(const std::wstring& filter);
583 void PopulateCookieInfoWithFilter(const std::wstring& filter);
584 void PopulateDatabaseInfoWithFilter(const std::wstring& filter); 584 void PopulateDatabaseInfoWithFilter(const std::wstring& filter);
585 void PopulateLocalStorageInfoWithFilter(const std::wstring& filter); 585 void PopulateLocalStorageInfoWithFilter(const std::wstring& filter);
586 void PopulateSessionStorageInfoWithFilter(const std::wstring& filter); 586 void PopulateSessionStorageInfoWithFilter(const std::wstring& filter);
587 void PopulateIndexedDBInfoWithFilter(const std::wstring& filter); 587 void PopulateIndexedDBInfoWithFilter(const std::wstring& filter);
588 void PopulateFileSystemInfoWithFilter(const std::wstring& filter); 588 void PopulateFileSystemInfoWithFilter(const std::wstring& filter);
589 589
590 void NotifyObserverBeginBatch(); 590 void NotifyObserverBeginBatch();
591 void NotifyObserverEndBatch(); 591 void NotifyObserverEndBatch();
592 592
593 scoped_refptr<net::CookieMonster> cookie_monster_;
594 CookieList all_cookies_;
595
596 scoped_refptr<BrowsingDataAppCacheHelper> appcache_helper_; 593 scoped_refptr<BrowsingDataAppCacheHelper> appcache_helper_;
594 scoped_refptr<BrowsingDataCookieHelper> cookie_helper_;
597 scoped_refptr<BrowsingDataDatabaseHelper> database_helper_; 595 scoped_refptr<BrowsingDataDatabaseHelper> database_helper_;
598 scoped_refptr<appcache::AppCacheInfoCollection> appcache_info_;
599 DatabaseInfoList database_info_list_;
600
601 scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_helper_; 596 scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_helper_;
602 scoped_refptr<BrowsingDataLocalStorageHelper> session_storage_helper_; 597 scoped_refptr<BrowsingDataLocalStorageHelper> session_storage_helper_;
603 scoped_refptr<BrowsingDataIndexedDBHelper> indexed_db_helper_; 598 scoped_refptr<BrowsingDataIndexedDBHelper> indexed_db_helper_;
604 scoped_refptr<BrowsingDataFileSystemHelper> file_system_helper_; 599 scoped_refptr<BrowsingDataFileSystemHelper> file_system_helper_;
600
601 scoped_refptr<appcache::AppCacheInfoCollection> appcache_info_;
602 CookieList cookie_list_;
603 DatabaseInfoList database_info_list_;
605 LocalStorageInfoList local_storage_info_list_; 604 LocalStorageInfoList local_storage_info_list_;
606 LocalStorageInfoList session_storage_info_list_; 605 LocalStorageInfoList session_storage_info_list_;
607 IndexedDBInfoList indexed_db_info_list_; 606 IndexedDBInfoList indexed_db_info_list_;
608 FileSystemInfoList file_system_info_list_; 607 FileSystemInfoList file_system_info_list_;
609 608
610 // The CookiesTreeModel maintains a separate list of observers that are 609 // The CookiesTreeModel maintains a separate list of observers that are
611 // specifically of the type CookiesTreeModel::Observer. 610 // specifically of the type CookiesTreeModel::Observer.
612 ObserverList<Observer> cookies_observer_list_; 611 ObserverList<Observer> cookies_observer_list_;
613 612
614 // If this is non-zero, then this model is batching updates (there's a lot of 613 // If this is non-zero, then this model is batching updates (there's a lot of
615 // notifications coming down the pipe). This is an integer is used to balance 614 // notifications coming down the pipe). This is an integer is used to balance
616 // calls to Begin/EndBatch() if they're called in a nested manner. 615 // calls to Begin/EndBatch() if they're called in a nested manner.
617 int batch_update_; 616 int batch_update_;
618 617
619 // If true, use the CanonicalCookie::Source attribute to group cookies. 618 // If true, use the CanonicalCookie::Source attribute to group cookies.
620 // Otherwise, use the CanonicalCookie::Domain attribute. 619 // Otherwise, use the CanonicalCookie::Domain attribute.
621 bool use_cookie_source_; 620 bool use_cookie_source_;
622 621
623 friend class CookieTreeAppCacheNode; 622 friend class CookieTreeAppCacheNode;
624 friend class CookieTreeCookieNode; 623 friend class CookieTreeCookieNode;
625 friend class CookieTreeDatabaseNode; 624 friend class CookieTreeDatabaseNode;
626 friend class CookieTreeLocalStorageNode; 625 friend class CookieTreeLocalStorageNode;
627 friend class CookieTreeIndexedDBNode; 626 friend class CookieTreeIndexedDBNode;
628 friend class CookieTreeFileSystemNode; 627 friend class CookieTreeFileSystemNode;
629 628
630 DISALLOW_COPY_AND_ASSIGN(CookiesTreeModel); 629 DISALLOW_COPY_AND_ASSIGN(CookiesTreeModel);
631 }; 630 };
632 631
633 #endif // CHROME_BROWSER_COOKIES_TREE_MODEL_H_ 632 #endif // CHROME_BROWSER_COOKIES_TREE_MODEL_H_
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/tab_specific_content_settings.cc ('k') | chrome/browser/cookies_tree_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698