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