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