| 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 #ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
| 6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 // Adds a single visit to the database, updating the URL information such | 606 // Adds a single visit to the database, updating the URL information such |
| 607 // as visit and typed count. The visit ID of the added visit and the URL ID | 607 // as visit and typed count. The visit ID of the added visit and the URL ID |
| 608 // of the associated URL (whether added or not) is returned. Both values will | 608 // of the associated URL (whether added or not) is returned. Both values will |
| 609 // be 0 on failure. | 609 // be 0 on failure. |
| 610 // | 610 // |
| 611 // This does not schedule database commits, it is intended to be used as a | 611 // This does not schedule database commits, it is intended to be used as a |
| 612 // subroutine for AddPage only. It also assumes the database is valid. | 612 // subroutine for AddPage only. It also assumes the database is valid. |
| 613 std::pair<URLID, VisitID> AddPageVisit(const GURL& url, | 613 std::pair<URLID, VisitID> AddPageVisit(const GURL& url, |
| 614 base::Time time, | 614 base::Time time, |
| 615 VisitID referring_visit, | 615 VisitID referring_visit, |
| 616 content::PageTransition transition, | 616 ui::PageTransition transition, |
| 617 VisitSource visit_source); | 617 VisitSource visit_source); |
| 618 | 618 |
| 619 // Returns a redirect chain in |redirects| for the VisitID | 619 // Returns a redirect chain in |redirects| for the VisitID |
| 620 // |cur_visit|. |cur_visit| is assumed to be valid. Assumes that | 620 // |cur_visit|. |cur_visit| is assumed to be valid. Assumes that |
| 621 // this HistoryBackend object has been Init()ed successfully. | 621 // this HistoryBackend object has been Init()ed successfully. |
| 622 void GetRedirectsFromSpecificVisit( | 622 void GetRedirectsFromSpecificVisit( |
| 623 VisitID cur_visit, history::RedirectList* redirects); | 623 VisitID cur_visit, history::RedirectList* redirects); |
| 624 | 624 |
| 625 // Similar to the above function except returns a redirect list ending | 625 // Similar to the above function except returns a redirect list ending |
| 626 // at |cur_visit|. | 626 // at |cur_visit|. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 | 665 |
| 666 // Walks back a segment chain to find the last visit with a non null segment | 666 // Walks back a segment chain to find the last visit with a non null segment |
| 667 // id and returns it. If there is none found, returns 0. | 667 // id and returns it. If there is none found, returns 0. |
| 668 SegmentID GetLastSegmentID(VisitID from_visit); | 668 SegmentID GetLastSegmentID(VisitID from_visit); |
| 669 | 669 |
| 670 // Update the segment information. This is called internally when a page is | 670 // Update the segment information. This is called internally when a page is |
| 671 // added. Return the segment id of the segment that has been updated. | 671 // added. Return the segment id of the segment that has been updated. |
| 672 SegmentID UpdateSegments(const GURL& url, | 672 SegmentID UpdateSegments(const GURL& url, |
| 673 VisitID from_visit, | 673 VisitID from_visit, |
| 674 VisitID visit_id, | 674 VisitID visit_id, |
| 675 content::PageTransition transition_type, | 675 ui::PageTransition transition_type, |
| 676 const base::Time ts); | 676 const base::Time ts); |
| 677 | 677 |
| 678 // Favicons ------------------------------------------------------------------ | 678 // Favicons ------------------------------------------------------------------ |
| 679 | 679 |
| 680 // Used by both UpdateFaviconMappingsAndFetch and GetFavicons. | 680 // Used by both UpdateFaviconMappingsAndFetch and GetFavicons. |
| 681 // If |page_url| is non-null, the icon urls for |page_url| (and all | 681 // If |page_url| is non-null, the icon urls for |page_url| (and all |
| 682 // redirects) are set to the subset of |icon_urls| for which icons are | 682 // redirects) are set to the subset of |icon_urls| for which icons are |
| 683 // already stored in the database. | 683 // already stored in the database. |
| 684 // If |page_url| is non-null, |icon_types| can be multiple icon types | 684 // If |page_url| is non-null, |icon_types| can be multiple icon types |
| 685 // only if |icon_types| == TOUCH_ICON | TOUCH_PRECOMPOSED_ICON. | 685 // only if |icon_types| == TOUCH_ICON | TOUCH_PRECOMPOSED_ICON. |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 | 892 |
| 893 // Listens for the system being under memory pressure. | 893 // Listens for the system being under memory pressure. |
| 894 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; | 894 scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
| 895 | 895 |
| 896 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 896 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
| 897 }; | 897 }; |
| 898 | 898 |
| 899 } // namespace history | 899 } // namespace history |
| 900 | 900 |
| 901 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 901 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
| OLD | NEW |