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.
5 #ifndef CHROME_BROWSER_ANDROID_HISTORY_REPORT_DELTA_FILE_SERVICE_H_
6 #define CHROME_BROWSER_ANDROID_HISTORY_REPORT_DELTA_FILE_SERVICE_H_
11 #include "base/memory/scoped_ptr.h"
12 #include "base/threading/sequenced_worker_pool.h"
20 namespace history_report
{
22 class DeltaFileEntryWithData
;
23 class DeltaFileBackend
;
25 // Delta file for gmscore integration and history reporting.
26 class DeltaFileService
{
28 explicit DeltaFileService(const base::FilePath
& dir
);
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
,
44 // Removes all entries from delta file.
47 // Dumps internal state to string.
52 base::SequencedWorkerPool::SequenceToken worker_pool_token_
;
53 scoped_ptr
<DeltaFileBackend
> delta_file_backend_
;
55 DISALLOW_COPY_AND_ASSIGN(DeltaFileService
);
58 } // namespace history_report
60 #endif // CHROME_BROWSER_ANDROID_HISTORY_REPORT_DELTA_FILE_SERVICE_H_