| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 // See NotifyRenderProcessHostDestruction. | 130 // See NotifyRenderProcessHostDestruction. |
| 131 void NotifyRenderProcessHostDestruction(const void* host); | 131 void NotifyRenderProcessHostDestruction(const void* host); |
| 132 | 132 |
| 133 // Navigation ---------------------------------------------------------------- | 133 // Navigation ---------------------------------------------------------------- |
| 134 | 134 |
| 135 void AddPage(scoped_refptr<HistoryAddPageArgs> request); | 135 void AddPage(scoped_refptr<HistoryAddPageArgs> request); |
| 136 virtual void SetPageTitle(const GURL& url, const string16& title); | 136 virtual void SetPageTitle(const GURL& url, const string16& title); |
| 137 void AddPageNoVisitForBookmark(const GURL& url); | 137 void AddPageNoVisitForBookmark(const GURL& url); |
| 138 | 138 |
| 139 // Updates the database backend with a page's ending time stamp information. |
| 140 // The page can be identified by the combination of the pointer to |
| 141 // a RenderProcessHost, the page id and the url. |
| 142 // |
| 143 // The given pointer will not be dereferenced, it is only used for |
| 144 // identification purposes, hence it is a void*. |
| 145 void UpdateWithPageEndTime(const void* host, |
| 146 int32 page_id, |
| 147 const GURL& url, |
| 148 const base::Time end_ts); |
| 149 |
| 150 |
| 139 // Indexing ------------------------------------------------------------------ | 151 // Indexing ------------------------------------------------------------------ |
| 140 | 152 |
| 141 void SetPageContents(const GURL& url, const string16& contents); | 153 void SetPageContents(const GURL& url, const string16& contents); |
| 142 | 154 |
| 143 // Querying ------------------------------------------------------------------ | 155 // Querying ------------------------------------------------------------------ |
| 144 | 156 |
| 145 // ScheduleAutocomplete() never frees |provider| (which is globally live). | 157 // ScheduleAutocomplete() never frees |provider| (which is globally live). |
| 146 // It passes |params| on to the autocomplete system which will eventually | 158 // It passes |params| on to the autocomplete system which will eventually |
| 147 // free it. | 159 // free it. |
| 148 void ScheduleAutocomplete(HistoryURLProvider* provider, | 160 void ScheduleAutocomplete(HistoryURLProvider* provider, |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, RemoveVisitsSource); | 396 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, RemoveVisitsSource); |
| 385 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, RemoveVisitsTransitions); | 397 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, RemoveVisitsTransitions); |
| 386 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MigrationVisitSource); | 398 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MigrationVisitSource); |
| 387 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MigrationIconMapping); | 399 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, MigrationIconMapping); |
| 388 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetFaviconMapping); | 400 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, SetFaviconMapping); |
| 389 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, AddOrUpdateIconMapping); | 401 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, AddOrUpdateIconMapping); |
| 390 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetMostRecentVisits); | 402 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetMostRecentVisits); |
| 391 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetFaviconForURL); | 403 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, GetFaviconForURL); |
| 392 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, | 404 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, |
| 393 CloneFaviconIsRestrictedToSameDomain); | 405 CloneFaviconIsRestrictedToSameDomain); |
| 394 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, | 406 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, QueryFilteredURLs); |
| 395 QueryFilteredURLs); | 407 FRIEND_TEST_ALL_PREFIXES(HistoryBackendTest, UpdateVisitDuration); |
| 396 | 408 |
| 397 friend class ::TestingProfile; | 409 friend class ::TestingProfile; |
| 398 | 410 |
| 399 // Computes the name of the specified database on disk. | 411 // Computes the name of the specified database on disk. |
| 400 FilePath GetThumbnailFileName() const; | 412 FilePath GetThumbnailFileName() const; |
| 401 | 413 |
| 402 // Returns the name of the Favicons database. This is the new name | 414 // Returns the name of the Favicons database. This is the new name |
| 403 // of the Thumbnails database. | 415 // of the Thumbnails database. |
| 404 // See ThumbnailDatabase::RenameAndDropThumbnails. | 416 // See ThumbnailDatabase::RenameAndDropThumbnails. |
| 405 FilePath GetFaviconsFileName() const; | 417 FilePath GetFaviconsFileName() const; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 428 // |cur_visit|. |cur_visit| is assumed to be valid. Assumes that | 440 // |cur_visit|. |cur_visit| is assumed to be valid. Assumes that |
| 429 // this HistoryBackend object has been Init()ed successfully. | 441 // this HistoryBackend object has been Init()ed successfully. |
| 430 void GetRedirectsFromSpecificVisit( | 442 void GetRedirectsFromSpecificVisit( |
| 431 VisitID cur_visit, history::RedirectList* redirects); | 443 VisitID cur_visit, history::RedirectList* redirects); |
| 432 | 444 |
| 433 // Similar to the above function except returns a redirect list ending | 445 // Similar to the above function except returns a redirect list ending |
| 434 // at |cur_visit|. | 446 // at |cur_visit|. |
| 435 void GetRedirectsToSpecificVisit( | 447 void GetRedirectsToSpecificVisit( |
| 436 VisitID cur_visit, history::RedirectList* redirects); | 448 VisitID cur_visit, history::RedirectList* redirects); |
| 437 | 449 |
| 450 // Update the visit_duration information in visits table. |
| 451 void UpdateVisitDuration(VisitID visit_id, const base::Time end_ts); |
| 452 |
| 438 // Thumbnail Helpers --------------------------------------------------------- | 453 // Thumbnail Helpers --------------------------------------------------------- |
| 439 | 454 |
| 440 // When a simple GetMostRecentRedirectsFrom() fails, this method is | 455 // When a simple GetMostRecentRedirectsFrom() fails, this method is |
| 441 // called which searches the last N visit sessions instead of just | 456 // called which searches the last N visit sessions instead of just |
| 442 // the current one. Returns true and puts thumbnail data in |data| | 457 // the current one. Returns true and puts thumbnail data in |data| |
| 443 // if a proper thumbnail was found. Returns false otherwise. Assumes | 458 // if a proper thumbnail was found. Returns false otherwise. Assumes |
| 444 // that this HistoryBackend object has been Init()ed successfully. | 459 // that this HistoryBackend object has been Init()ed successfully. |
| 445 bool GetThumbnailFromOlderRedirect( | 460 bool GetThumbnailFromOlderRedirect( |
| 446 const GURL& page_url, std::vector<unsigned char>* data); | 461 const GURL& page_url, std::vector<unsigned char>* data); |
| 447 | 462 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 // Publishes the history to all indexers which are registered to receive | 672 // Publishes the history to all indexers which are registered to receive |
| 658 // history data from us. Can be NULL if there are no listeners. | 673 // history data from us. Can be NULL if there are no listeners. |
| 659 scoped_ptr<HistoryPublisher> history_publisher_; | 674 scoped_ptr<HistoryPublisher> history_publisher_; |
| 660 | 675 |
| 661 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 676 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
| 662 }; | 677 }; |
| 663 | 678 |
| 664 } // namespace history | 679 } // namespace history |
| 665 | 680 |
| 666 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 681 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
| OLD | NEW |