OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 COMPONENTS_HISTORY_CORE_BROWSER_DELETE_DIRECTIVE_HANDLER_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_DELETE_DIRECTIVE_HANDLER_H_ |
6 #define COMPONENTS_HISTORY_CORE_BROWSER_DELETE_DIRECTIVE_HANDLER_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_DELETE_DIRECTIVE_HANDLER_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
8 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
10 #include "base/task/cancelable_task_tracker.h" | 13 #include "base/task/cancelable_task_tracker.h" |
11 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
12 #include "sync/api/sync_change_processor.h" | 15 #include "sync/api/sync_change_processor.h" |
13 #include "sync/api/sync_data.h" | 16 #include "sync/api/sync_data.h" |
14 | 17 |
15 namespace sync_pb { | 18 namespace sync_pb { |
16 class HistoryDeleteDirectiveSpecifics; | 19 class HistoryDeleteDirectiveSpecifics; |
17 } | 20 } |
(...skipping 12 matching lines...) Expand all Loading... |
30 | 33 |
31 // Start/stop processing delete directives when sync is enabled/disabled. | 34 // Start/stop processing delete directives when sync is enabled/disabled. |
32 void Start(HistoryService* history_service, | 35 void Start(HistoryService* history_service, |
33 const syncer::SyncDataList& initial_sync_data, | 36 const syncer::SyncDataList& initial_sync_data, |
34 scoped_ptr<syncer::SyncChangeProcessor> sync_processor); | 37 scoped_ptr<syncer::SyncChangeProcessor> sync_processor); |
35 void Stop(); | 38 void Stop(); |
36 | 39 |
37 // Create delete directives for the deletion of visits identified by | 40 // Create delete directives for the deletion of visits identified by |
38 // |global_ids| (which may be empty), in the time range specified by | 41 // |global_ids| (which may be empty), in the time range specified by |
39 // |begin_time| and |end_time|. | 42 // |begin_time| and |end_time|. |
40 bool CreateDeleteDirectives(const std::set<int64>& global_ids, | 43 bool CreateDeleteDirectives(const std::set<int64_t>& global_ids, |
41 base::Time begin_time, | 44 base::Time begin_time, |
42 base::Time end_time); | 45 base::Time end_time); |
43 | 46 |
44 // Sends the given |delete_directive| to SyncChangeProcessor (if it exists). | 47 // Sends the given |delete_directive| to SyncChangeProcessor (if it exists). |
45 // Returns any error resulting from sending the delete directive to sync. | 48 // Returns any error resulting from sending the delete directive to sync. |
46 // NOTE: the given |delete_directive| is not processed to remove local | 49 // NOTE: the given |delete_directive| is not processed to remove local |
47 // history entries that match. Caller still needs to call other | 50 // history entries that match. Caller still needs to call other |
48 // interfaces, e.g. HistoryService::ExpireHistoryBetween(), to delete | 51 // interfaces, e.g. HistoryService::ExpireHistoryBetween(), to delete |
49 // local history entries. | 52 // local history entries. |
50 syncer::SyncError ProcessLocalDeleteDirective( | 53 syncer::SyncError ProcessLocalDeleteDirective( |
(...skipping 20 matching lines...) Expand all Loading... |
71 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; | 74 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; |
72 base::ThreadChecker thread_checker_; | 75 base::ThreadChecker thread_checker_; |
73 base::WeakPtrFactory<DeleteDirectiveHandler> weak_ptr_factory_; | 76 base::WeakPtrFactory<DeleteDirectiveHandler> weak_ptr_factory_; |
74 | 77 |
75 DISALLOW_COPY_AND_ASSIGN(DeleteDirectiveHandler); | 78 DISALLOW_COPY_AND_ASSIGN(DeleteDirectiveHandler); |
76 }; | 79 }; |
77 | 80 |
78 } // namespace history | 81 } // namespace history |
79 | 82 |
80 #endif // COMPONENTS_HISTORY_CORE_BROWSER_DELETE_DIRECTIVE_HANDLER_H_ | 83 #endif // COMPONENTS_HISTORY_CORE_BROWSER_DELETE_DIRECTIVE_HANDLER_H_ |
OLD | NEW |