OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_RENDERER_VISITEDLINK_SLAVE_H_ | 5 #ifndef CHROME_RENDERER_VISITEDLINK_SLAVE_H_ |
6 #define CHROME_RENDERER_VISITEDLINK_SLAVE_H_ | 6 #define CHROME_RENDERER_VISITEDLINK_SLAVE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include "base/compiler_specific.h" |
9 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
10 #include "chrome/common/visitedlink_common.h" | 11 #include "chrome/common/visitedlink_common.h" |
11 #include "content/public/renderer/render_process_observer.h" | 12 #include "content/public/renderer/render_process_observer.h" |
12 | 13 |
13 // Reads the link coloring database provided by the master. There can be any | 14 // Reads the link coloring database provided by the master. There can be any |
14 // number of slaves reading the same database. | 15 // number of slaves reading the same database. |
15 class VisitedLinkSlave : public VisitedLinkCommon, | 16 class VisitedLinkSlave : public VisitedLinkCommon, |
16 public content::RenderProcessObserver { | 17 public content::RenderProcessObserver { |
17 public: | 18 public: |
18 VisitedLinkSlave(); | 19 VisitedLinkSlave(); |
19 virtual ~VisitedLinkSlave(); | 20 virtual ~VisitedLinkSlave(); |
20 | 21 |
21 // RenderProcessObserver implementation. | 22 // RenderProcessObserver implementation. |
22 virtual bool OnControlMessageReceived(const IPC::Message& message); | 23 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
23 | 24 |
24 // Message handlers. | 25 // Message handlers. |
25 void OnUpdateVisitedLinks(base::SharedMemoryHandle table); | 26 void OnUpdateVisitedLinks(base::SharedMemoryHandle table); |
26 void OnAddVisitedLinks(const VisitedLinkSlave::Fingerprints& fingerprints); | 27 void OnAddVisitedLinks(const VisitedLinkSlave::Fingerprints& fingerprints); |
27 void OnResetVisitedLinks(); | 28 void OnResetVisitedLinks(); |
28 private: | 29 private: |
29 void FreeTable(); | 30 void FreeTable(); |
30 | 31 |
31 // shared memory consists of a SharedHeader followed by the table | 32 // shared memory consists of a SharedHeader followed by the table |
32 base::SharedMemory* shared_memory_; | 33 base::SharedMemory* shared_memory_; |
33 | 34 |
34 DISALLOW_COPY_AND_ASSIGN(VisitedLinkSlave); | 35 DISALLOW_COPY_AND_ASSIGN(VisitedLinkSlave); |
35 }; | 36 }; |
36 | 37 |
37 #endif // CHROME_RENDERER_VISITEDLINK_SLAVE_H_ | 38 #endif // CHROME_RENDERER_VISITEDLINK_SLAVE_H_ |
OLD | NEW |