OLD | NEW |
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_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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 // Adds a single visit to the database, updating the URL information such | 388 // Adds a single visit to the database, updating the URL information such |
389 // as visit and typed count. The visit ID of the added visit and the URL ID | 389 // as visit and typed count. The visit ID of the added visit and the URL ID |
390 // of the associated URL (whether added or not) is returned. Both values will | 390 // of the associated URL (whether added or not) is returned. Both values will |
391 // be 0 on failure. | 391 // be 0 on failure. |
392 // | 392 // |
393 // This does not schedule database commits, it is intended to be used as a | 393 // This does not schedule database commits, it is intended to be used as a |
394 // subroutine for AddPage only. It also assumes the database is valid. | 394 // subroutine for AddPage only. It also assumes the database is valid. |
395 std::pair<URLID, VisitID> AddPageVisit(const GURL& url, | 395 std::pair<URLID, VisitID> AddPageVisit(const GURL& url, |
396 base::Time time, | 396 base::Time time, |
397 VisitID referring_visit, | 397 VisitID referring_visit, |
398 PageTransition::Type transition, | 398 content::PageTransition transition, |
399 VisitSource visit_source); | 399 VisitSource visit_source); |
400 | 400 |
401 // Returns a redirect chain in |redirects| for the VisitID | 401 // Returns a redirect chain in |redirects| for the VisitID |
402 // |cur_visit|. |cur_visit| is assumed to be valid. Assumes that | 402 // |cur_visit|. |cur_visit| is assumed to be valid. Assumes that |
403 // this HistoryBackend object has been Init()ed successfully. | 403 // this HistoryBackend object has been Init()ed successfully. |
404 void GetRedirectsFromSpecificVisit( | 404 void GetRedirectsFromSpecificVisit( |
405 VisitID cur_visit, history::RedirectList* redirects); | 405 VisitID cur_visit, history::RedirectList* redirects); |
406 | 406 |
407 // Similar to the above function except returns a redirect list ending | 407 // Similar to the above function except returns a redirect list ending |
408 // at |cur_visit|. | 408 // at |cur_visit|. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 | 454 |
455 // Walks back a segment chain to find the last visit with a non null segment | 455 // Walks back a segment chain to find the last visit with a non null segment |
456 // id and returns it. If there is none found, returns 0. | 456 // id and returns it. If there is none found, returns 0. |
457 SegmentID GetLastSegmentID(VisitID from_visit); | 457 SegmentID GetLastSegmentID(VisitID from_visit); |
458 | 458 |
459 // Update the segment information. This is called internally when a page is | 459 // Update the segment information. This is called internally when a page is |
460 // added. Return the segment id of the segment that has been updated. | 460 // added. Return the segment id of the segment that has been updated. |
461 SegmentID UpdateSegments(const GURL& url, | 461 SegmentID UpdateSegments(const GURL& url, |
462 VisitID from_visit, | 462 VisitID from_visit, |
463 VisitID visit_id, | 463 VisitID visit_id, |
464 PageTransition::Type transition_type, | 464 content::PageTransition transition_type, |
465 const base::Time ts); | 465 const base::Time ts); |
466 | 466 |
467 // Favicons ------------------------------------------------------------------ | 467 // Favicons ------------------------------------------------------------------ |
468 | 468 |
469 // Used by both UpdateFaviconMappingAndFetch and GetFavicon. | 469 // Used by both UpdateFaviconMappingAndFetch and GetFavicon. |
470 // If page_url is non-null and SetFavicon has previously been invoked for | 470 // If page_url is non-null and SetFavicon has previously been invoked for |
471 // icon_url the favicon url for page_url (and all redirects) is set to | 471 // icon_url the favicon url for page_url (and all redirects) is set to |
472 // icon_url. | 472 // icon_url. |
473 // Only a single type can be given in icon_type when page_url is specified. | 473 // Only a single type can be given in icon_type when page_url is specified. |
474 void UpdateFaviconMappingAndFetchImpl( | 474 void UpdateFaviconMappingAndFetchImpl( |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 // Publishes the history to all indexers which are registered to receive | 631 // Publishes the history to all indexers which are registered to receive |
632 // history data from us. Can be NULL if there are no listeners. | 632 // history data from us. Can be NULL if there are no listeners. |
633 scoped_ptr<HistoryPublisher> history_publisher_; | 633 scoped_ptr<HistoryPublisher> history_publisher_; |
634 | 634 |
635 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 635 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
636 }; | 636 }; |
637 | 637 |
638 } // namespace history | 638 } // namespace history |
639 | 639 |
640 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 640 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
OLD | NEW |