OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 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 // VisitedLinkEventListener broadcasts link coloring database updates to all |
| 6 // processes. It also coalesces the updates to avoid excessive broadcasting of |
| 7 // messages to the renderers. |
| 8 |
| 9 #ifndef VISITEDLINK_EVENT_LISTENER_H_ |
| 10 #define VISITEDLINK_EVENT_LISTENER_H_ |
| 11 |
| 12 #include "base/timer.h" |
| 13 #include "chrome/browser/visitedlink_master.h" |
| 14 |
| 15 namespace base { |
| 16 class SharedMemory; |
| 17 } |
| 18 |
| 19 class VisitedLinkEventListener : public VisitedLinkMaster::Listener { |
| 20 public: |
| 21 VisitedLinkEventListener() {} |
| 22 virtual ~VisitedLinkEventListener() {} |
| 23 |
| 24 virtual void NewTable(base::SharedMemory* table_memory); |
| 25 virtual void Add(VisitedLinkMaster::Fingerprint fingerprint); |
| 26 virtual void Reset(); |
| 27 |
| 28 private: |
| 29 void CommitVisitedLinks(); |
| 30 |
| 31 base::OneShotTimer<VisitedLinkEventListener> coalesce_timer_; |
| 32 VisitedLinkCommon::Fingerprints pending_visited_links_; |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(VisitedLinkEventListener); |
| 35 }; |
| 36 |
| 37 #endif // VISITEDLINK_EVENT_LISTENER_H_ |
OLD | NEW |