Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1307)

Side by Side Diff: chrome/browser/android/history_report/delta_file_service.h

Issue 1141283003: Upstream oodles of Chrome for Android code into Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: final patch? Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_ANDROID_HISTORY_REPORT_DELTA_FILE_SERVICE_H_
6 #define CHROME_BROWSER_ANDROID_HISTORY_REPORT_DELTA_FILE_SERVICE_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/memory/scoped_ptr.h"
12 #include "base/threading/sequenced_worker_pool.h"
13
14 class GURL;
15
16 namespace base {
17 class FilePath;
18 } // namespace base
19
20 namespace history_report {
21
22 class DeltaFileEntryWithData;
23 class DeltaFileBackend;
24
25 // Delta file for gmscore integration and history reporting.
26 class DeltaFileService {
27 public:
28 explicit DeltaFileService(const base::FilePath& dir);
29 ~DeltaFileService();
30
31 // Adds new addtion entry to delta file.
32 void PageAdded(const GURL& url);
33 // Adds new deletion entry to delta file.
34 void PageDeleted(const GURL& url);
35 // Removes all delta file entries with seqno <= lower_bound.
36 // Returns max seqno in delta file.
37 int64 Trim(int64 lower_bound);
38 // Removes all data from delta file and populates it with new addition
39 // entries for given urls.
40 bool Recreate(const std::vector<std::string>& urls);
41 // Provides up to limit delta file entries with seqno > last_seq_no.
42 scoped_ptr<std::vector<DeltaFileEntryWithData> > Query(int64 last_seq_no,
43 int32 limit);
44 // Removes all entries from delta file.
45 void Clear();
46
47 // Dumps internal state to string.
48 std::string Dump();
49
50 private:
51
52 base::SequencedWorkerPool::SequenceToken worker_pool_token_;
53 scoped_ptr<DeltaFileBackend> delta_file_backend_;
54
55 DISALLOW_COPY_AND_ASSIGN(DeltaFileService);
56 };
57
58 } // namespace history_report
59
60 #endif // CHROME_BROWSER_ANDROID_HISTORY_REPORT_DELTA_FILE_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698