OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/visitedlink_event_listener.h" | 5 #include "chrome/browser/visitedlink_event_listener.h" |
6 | 6 |
7 #include "base/shared_memory.h" | 7 #include "base/shared_memory.h" |
8 #include "chrome/browser/renderer_host/render_process_host.h" | 8 #include "chrome/browser/renderer_host/render_process_host.h" |
| 9 #include "chrome/common/render_messages.h" |
9 | 10 |
10 using base::Time; | 11 using base::Time; |
11 using base::TimeDelta; | 12 using base::TimeDelta; |
12 | 13 |
13 // The amount of time we wait to accumulate visited link additions. | 14 // The amount of time we wait to accumulate visited link additions. |
14 static const int kCommitIntervalMs = 100; | 15 static const int kCommitIntervalMs = 100; |
15 | 16 |
16 void VisitedLinkEventListener::NewTable(base::SharedMemory* table_memory) { | 17 void VisitedLinkEventListener::NewTable(base::SharedMemory* table_memory) { |
17 if (!table_memory) | 18 if (!table_memory) |
18 return; | 19 return; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 51 |
51 void VisitedLinkEventListener::CommitVisitedLinks() { | 52 void VisitedLinkEventListener::CommitVisitedLinks() { |
52 // Send to all RenderProcessHosts. | 53 // Send to all RenderProcessHosts. |
53 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); | 54 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); |
54 !i.IsAtEnd(); i.Advance()) { | 55 !i.IsAtEnd(); i.Advance()) { |
55 i.GetCurrentValue()->AddVisitedLinks(pending_visited_links_); | 56 i.GetCurrentValue()->AddVisitedLinks(pending_visited_links_); |
56 } | 57 } |
57 | 58 |
58 pending_visited_links_.clear(); | 59 pending_visited_links_.clear(); |
59 } | 60 } |
OLD | NEW |