OLD | NEW |
1 // Copyright (c) 2011 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 CONTENT_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // renderer via this RenderProcessHost. | 25 // renderer via this RenderProcessHost. |
26 IPC::TestSink& sink() { return sink_; } | 26 IPC::TestSink& sink() { return sink_; } |
27 | 27 |
28 // Provides tests access to the max page ID currently used for this process. | 28 // Provides tests access to the max page ID currently used for this process. |
29 int max_page_id() const { return max_page_id_; } | 29 int max_page_id() const { return max_page_id_; } |
30 | 30 |
31 // Provides test access to how many times a bad message has been received. | 31 // Provides test access to how many times a bad message has been received. |
32 int bad_msg_count() const { return bad_msg_count_; } | 32 int bad_msg_count() const { return bad_msg_count_; } |
33 | 33 |
34 // RenderProcessHost implementation (public portion). | 34 // RenderProcessHost implementation (public portion). |
35 virtual void EnableSendQueue(); | 35 virtual void EnableSendQueue() OVERRIDE; |
36 virtual bool Init(bool is_accessibility_enabled); | 36 virtual bool Init(bool is_accessibility_enabled) OVERRIDE; |
37 virtual int GetNextRoutingID(); | 37 virtual int GetNextRoutingID() OVERRIDE; |
38 virtual void CancelResourceRequests(int render_widget_id); | 38 virtual void CancelResourceRequests(int render_widget_id) OVERRIDE; |
39 virtual void CrossSiteSwapOutACK(const ViewMsg_SwapOut_Params& params); | 39 virtual void CrossSiteSwapOutACK( |
| 40 const ViewMsg_SwapOut_Params& params) OVERRIDE; |
40 virtual bool WaitForUpdateMsg(int render_widget_id, | 41 virtual bool WaitForUpdateMsg(int render_widget_id, |
41 const base::TimeDelta& max_delay, | 42 const base::TimeDelta& max_delay, |
42 IPC::Message* msg); | 43 IPC::Message* msg) OVERRIDE; |
43 virtual void ReceivedBadMessage(); | 44 virtual void ReceivedBadMessage() OVERRIDE; |
44 virtual void WidgetRestored(); | 45 virtual void WidgetRestored() OVERRIDE; |
45 virtual void WidgetHidden(); | 46 virtual void WidgetHidden() OVERRIDE; |
46 virtual int VisibleWidgetCount() const; | 47 virtual int VisibleWidgetCount() const OVERRIDE; |
47 virtual void AddWord(const string16& word); | 48 virtual void AddWord(const string16& word); |
48 virtual bool FastShutdownIfPossible(); | 49 virtual bool FastShutdownIfPossible() OVERRIDE; |
49 virtual void DumpHandles(); | 50 virtual void DumpHandles() OVERRIDE; |
50 virtual base::ProcessHandle GetHandle(); | 51 virtual base::ProcessHandle GetHandle() OVERRIDE; |
51 virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id); | 52 virtual TransportDIB* GetTransportDIB(TransportDIB::Id dib_id) OVERRIDE; |
52 virtual void SetCompositingSurface( | 53 virtual void SetCompositingSurface( |
53 int render_widget_id, | 54 int render_widget_id, |
54 gfx::PluginWindowHandle compositing_surface); | 55 gfx::PluginWindowHandle compositing_surface) OVERRIDE; |
55 | 56 |
56 // IPC::Channel::Sender via RenderProcessHost. | 57 // IPC::Channel::Sender via RenderProcessHost. |
57 virtual bool Send(IPC::Message* msg); | 58 virtual bool Send(IPC::Message* msg) OVERRIDE; |
58 | 59 |
59 // IPC::Channel::Listener via RenderProcessHost. | 60 // IPC::Channel::Listener via RenderProcessHost. |
60 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 61 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
61 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 62 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
62 | 63 |
63 // Attaches the factory object so we can remove this object in its destructor | 64 // Attaches the factory object so we can remove this object in its destructor |
64 // and prevent MockRenderProcessHostFacotry from deleting it. | 65 // and prevent MockRenderProcessHostFacotry from deleting it. |
65 void SetFactory(const MockRenderProcessHostFactory* factory) { | 66 void SetFactory(const MockRenderProcessHostFactory* factory) { |
66 factory_ = factory; | 67 factory_ = factory; |
67 } | 68 } |
(...skipping 24 matching lines...) Expand all Loading... |
92 private: | 93 private: |
93 // A list of MockRenderProcessHosts created by this object. This list is used | 94 // A list of MockRenderProcessHosts created by this object. This list is used |
94 // for deleting all MockRenderProcessHosts that have not deleted by a test in | 95 // for deleting all MockRenderProcessHosts that have not deleted by a test in |
95 // the destructor and prevent them from being leaked. | 96 // the destructor and prevent them from being leaked. |
96 mutable ScopedVector<MockRenderProcessHost> processes_; | 97 mutable ScopedVector<MockRenderProcessHost> processes_; |
97 | 98 |
98 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory); | 99 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory); |
99 }; | 100 }; |
100 | 101 |
101 #endif // CONTENT_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ | 102 #endif // CONTENT_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_ |
OLD | NEW |