| 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_ANDROID_BOOKMARK_MODEL_SQL_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_ANDROID_BOOKMARK_MODEL_SQL_HANDLER_H_ |
| 6 #define CHROME_BROWSER_HISTORY_ANDROID_BOOKMARK_MODEL_SQL_HANDLER_H_ | 6 #define CHROME_BROWSER_HISTORY_ANDROID_BOOKMARK_MODEL_SQL_HANDLER_H_ |
| 7 | 7 |
| 8 #include "components/history/core/browser/android/sql_handler.h" | 8 #include "components/history/core/browser/android/sql_handler.h" |
| 9 | 9 |
| 10 class Profile; | 10 class Profile; |
| 11 | 11 |
| 12 namespace bookmarks { | 12 namespace bookmarks { |
| 13 class BookmarkModel; | 13 class BookmarkModel; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace history { | 16 namespace history { |
| 17 | 17 |
| 18 class HistoryDatabase; | 18 class HistoryDatabase; |
| 19 | 19 |
| 20 // The SQL handler for bookmarking_mapping table. | 20 // The SQL handler for bookmarking_mapping table. |
| 21 class BookmarkModelSQLHandler : public SQLHandler { | 21 class BookmarkModelSQLHandler : public SQLHandler { |
| 22 public: | 22 public: |
| 23 explicit BookmarkModelSQLHandler(URLDatabase* url_database); | 23 explicit BookmarkModelSQLHandler(URLDatabase* url_database); |
| 24 | 24 |
| 25 virtual ~BookmarkModelSQLHandler(); | 25 ~BookmarkModelSQLHandler() override; |
| 26 | 26 |
| 27 // SQLHandler overrides: | 27 // SQLHandler overrides: |
| 28 virtual bool Update(const HistoryAndBookmarkRow& row, | 28 bool Update(const HistoryAndBookmarkRow& row, |
| 29 const TableIDRows& ids_set) override; | 29 const TableIDRows& ids_set) override; |
| 30 virtual bool Delete(const TableIDRows& ids_set) override; | 30 bool Delete(const TableIDRows& ids_set) override; |
| 31 virtual bool Insert(HistoryAndBookmarkRow* row) override; | 31 bool Insert(HistoryAndBookmarkRow* row) override; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 // This class helps to modify the bookmark model in UI thread. | 34 // This class helps to modify the bookmark model in UI thread. |
| 35 // The instance of this class is created in history thread and posted to | 35 // The instance of this class is created in history thread and posted to |
| 36 // UI thread to access the bookmark. All method must be run in UI thread. | 36 // UI thread to access the bookmark. All method must be run in UI thread. |
| 37 class Task : public base::RefCountedThreadSafe<Task> { | 37 class Task : public base::RefCountedThreadSafe<Task> { |
| 38 public: | 38 public: |
| 39 // |profile| is the profile whose BookmarkModel will be modified. | 39 // |profile| is the profile whose BookmarkModel will be modified. |
| 40 // | 40 // |
| 41 // As this class is instantiated in history thread, the |profile| will be | 41 // As this class is instantiated in history thread, the |profile| will be |
| (...skipping 29 matching lines...) Expand all Loading... |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 URLDatabase* url_database_; | 73 URLDatabase* url_database_; |
| 74 | 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(BookmarkModelSQLHandler); | 75 DISALLOW_COPY_AND_ASSIGN(BookmarkModelSQLHandler); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 } // namespace history. | 78 } // namespace history. |
| 79 | 79 |
| 80 #endif // CHROME_BROWSER_HISTORY_ANDROID_BOOKMARK_MODEL_SQL_HANDLER_H_ | 80 #endif // CHROME_BROWSER_HISTORY_ANDROID_BOOKMARK_MODEL_SQL_HANDLER_H_ |
| OLD | NEW |