OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_ANDROID_HISTORY_REPORT_DATA_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_HISTORY_REPORT_DATA_PROVIDER_H_ |
6 #define CHROME_BROWSER_ANDROID_HISTORY_REPORT_DATA_PROVIDER_H_ | 6 #define CHROME_BROWSER_ANDROID_HISTORY_REPORT_DATA_PROVIDER_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <vector> | 10 #include <vector> |
9 | 11 |
| 12 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
11 #include "base/task/cancelable_task_tracker.h" | 14 #include "base/task/cancelable_task_tracker.h" |
12 | 15 |
13 class Profile; | 16 class Profile; |
14 | 17 |
15 namespace history { | 18 namespace history { |
16 class HistoryService; | 19 class HistoryService; |
17 } | 20 } |
18 | 21 |
19 namespace bookmarks { | 22 namespace bookmarks { |
20 class BookmarkModel; | 23 class BookmarkModel; |
21 } | 24 } |
22 | 25 |
23 namespace history_report { | 26 namespace history_report { |
24 | 27 |
25 class DeltaFileEntryWithData; | 28 class DeltaFileEntryWithData; |
26 class DeltaFileService; | 29 class DeltaFileService; |
27 class UsageReportsBufferService; | 30 class UsageReportsBufferService; |
28 | 31 |
29 // Provides data from History and Bookmark backends. | 32 // Provides data from History and Bookmark backends. |
30 class DataProvider { | 33 class DataProvider { |
31 public: | 34 public: |
32 DataProvider(Profile* profile, | 35 DataProvider(Profile* profile, |
33 DeltaFileService* delta_file_service, | 36 DeltaFileService* delta_file_service, |
34 bookmarks::BookmarkModel* bookmark_model); | 37 bookmarks::BookmarkModel* bookmark_model); |
35 ~DataProvider(); | 38 ~DataProvider(); |
36 | 39 |
37 // Provides up to limit delta file entries with sequence number > last_seq_no. | 40 // Provides up to limit delta file entries with sequence number > last_seq_no. |
38 scoped_ptr<std::vector<DeltaFileEntryWithData> > Query(int64 last_seq_no, | 41 scoped_ptr<std::vector<DeltaFileEntryWithData>> Query(int64_t last_seq_no, |
39 int32 limit); | 42 int32_t limit); |
40 void StartVisitMigrationToUsageBuffer( | 43 void StartVisitMigrationToUsageBuffer( |
41 UsageReportsBufferService* buffer_service); | 44 UsageReportsBufferService* buffer_service); |
42 | 45 |
43 private: | 46 private: |
44 void RecreateLog(); | 47 void RecreateLog(); |
45 | 48 |
46 history::HistoryService* history_service_; | 49 history::HistoryService* history_service_; |
47 bookmarks::BookmarkModel* bookmark_model_; | 50 bookmarks::BookmarkModel* bookmark_model_; |
48 DeltaFileService* delta_file_service_; | 51 DeltaFileService* delta_file_service_; |
49 base::CancelableTaskTracker history_task_tracker_; | 52 base::CancelableTaskTracker history_task_tracker_; |
50 | 53 |
51 DISALLOW_COPY_AND_ASSIGN(DataProvider); | 54 DISALLOW_COPY_AND_ASSIGN(DataProvider); |
52 }; | 55 }; |
53 | 56 |
54 } // namespace history_report | 57 } // namespace history_report |
55 | 58 |
56 #endif // CHROME_BROWSER_ANDROID_HISTORY_REPORT_DATA_PROVIDER_H_ | 59 #endif // CHROME_BROWSER_ANDROID_HISTORY_REPORT_DATA_PROVIDER_H_ |
OLD | NEW |