| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // there may be no in-memory database. | 68 // there may be no in-memory database. |
| 69 // | 69 // |
| 70 // Ownership of the backend pointer is transferred to this function. | 70 // Ownership of the backend pointer is transferred to this function. |
| 71 virtual void SetInMemoryBackend(InMemoryHistoryBackend* backend) = 0; | 71 virtual void SetInMemoryBackend(InMemoryHistoryBackend* backend) = 0; |
| 72 | 72 |
| 73 // Broadcasts the specified notification to the notification service. | 73 // Broadcasts the specified notification to the notification service. |
| 74 // This is implemented here because notifications must only be sent from | 74 // This is implemented here because notifications must only be sent from |
| 75 // the main thread. | 75 // the main thread. |
| 76 // | 76 // |
| 77 // Ownership of the HistoryDetails is transferred to this function. | 77 // Ownership of the HistoryDetails is transferred to this function. |
| 78 virtual void BroadcastNotifications(NotificationType type, | 78 virtual void BroadcastNotifications(int type, |
| 79 HistoryDetails* details) = 0; | 79 HistoryDetails* details) = 0; |
| 80 | 80 |
| 81 // Invoked when the backend has finished loading the db. | 81 // Invoked when the backend has finished loading the db. |
| 82 virtual void DBLoaded() = 0; | 82 virtual void DBLoaded() = 0; |
| 83 | 83 |
| 84 // Tell TopSites to start reading thumbnails from the ThumbnailsDB. | 84 // Tell TopSites to start reading thumbnails from the ThumbnailsDB. |
| 85 virtual void StartTopSitesMigration() = 0; | 85 virtual void StartTopSitesMigration() = 0; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 // Init must be called to complete object creation. This object can be | 88 // Init must be called to complete object creation. This object can be |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 // Processes the next scheduled HistoryDBTask, scheduling this method | 480 // Processes the next scheduled HistoryDBTask, scheduling this method |
| 481 // to be invoked again if there are more tasks that need to run. | 481 // to be invoked again if there are more tasks that need to run. |
| 482 void ProcessDBTaskImpl(); | 482 void ProcessDBTaskImpl(); |
| 483 | 483 |
| 484 // Release all tasks in history_db_tasks_ and clears it. | 484 // Release all tasks in history_db_tasks_ and clears it. |
| 485 void ReleaseDBTasks(); | 485 void ReleaseDBTasks(); |
| 486 | 486 |
| 487 // Schedules a broadcast of the given notification on the main thread. The | 487 // Schedules a broadcast of the given notification on the main thread. The |
| 488 // details argument will have ownership taken by this function (it will be | 488 // details argument will have ownership taken by this function (it will be |
| 489 // sent to the main thread and deleted there). | 489 // sent to the main thread and deleted there). |
| 490 virtual void BroadcastNotifications(NotificationType type, | 490 virtual void BroadcastNotifications(int type, |
| 491 HistoryDetails* details_deleted); | 491 HistoryDetails* details_deleted); |
| 492 | 492 |
| 493 // Deleting all history ------------------------------------------------------ | 493 // Deleting all history ------------------------------------------------------ |
| 494 | 494 |
| 495 // Deletes all history. This is a special case of deleting that is separated | 495 // Deletes all history. This is a special case of deleting that is separated |
| 496 // from our normal dependency-following method for performance reasons. The | 496 // from our normal dependency-following method for performance reasons. The |
| 497 // logic lives here instead of ExpireHistoryBackend since it will cause | 497 // logic lives here instead of ExpireHistoryBackend since it will cause |
| 498 // re-initialization of some databases such as Thumbnails or Archived that | 498 // re-initialization of some databases such as Thumbnails or Archived that |
| 499 // could fail. When these databases are not valid, our pointers must be NULL, | 499 // could fail. When these databases are not valid, our pointers must be NULL, |
| 500 // so we need to handle this type of operation to keep the pointers in sync. | 500 // so we need to handle this type of operation to keep the pointers in sync. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 // Publishes the history to all indexers which are registered to receive | 603 // Publishes the history to all indexers which are registered to receive |
| 604 // history data from us. Can be NULL if there are no listeners. | 604 // history data from us. Can be NULL if there are no listeners. |
| 605 scoped_ptr<HistoryPublisher> history_publisher_; | 605 scoped_ptr<HistoryPublisher> history_publisher_; |
| 606 | 606 |
| 607 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 607 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
| 608 }; | 608 }; |
| 609 | 609 |
| 610 } // namespace history | 610 } // namespace history |
| 611 | 611 |
| 612 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 612 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
| OLD | NEW |