OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ |
6 #define CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ | 6 #define CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <memory> | 10 #include <memory> |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 bool incoming, | 94 bool incoming, |
95 bool outgoing, | 95 bool outgoing, |
96 const WebRtcRtpPacketCallback& packet_callback) override; | 96 const WebRtcRtpPacketCallback& packet_callback) override; |
97 #endif | 97 #endif |
98 void ResumeDeferredNavigation(const GlobalRequestID& request_id) override; | 98 void ResumeDeferredNavigation(const GlobalRequestID& request_id) override; |
99 service_manager::InterfaceProvider* GetRemoteInterfaces() override; | 99 service_manager::InterfaceProvider* GetRemoteInterfaces() override; |
100 std::unique_ptr<base::SharedPersistentMemoryAllocator> TakeMetricsAllocator() | 100 std::unique_ptr<base::SharedPersistentMemoryAllocator> TakeMetricsAllocator() |
101 override; | 101 override; |
102 const base::TimeTicks& GetInitTimeForNavigationMetrics() const override; | 102 const base::TimeTicks& GetInitTimeForNavigationMetrics() const override; |
103 bool IsProcessBackgrounded() const override; | 103 bool IsProcessBackgrounded() const override; |
| 104 size_t GetWorkerRefCount() const override; |
104 void IncrementServiceWorkerRefCount() override; | 105 void IncrementServiceWorkerRefCount() override; |
105 void DecrementServiceWorkerRefCount() override; | 106 void DecrementServiceWorkerRefCount() override; |
106 void IncrementSharedWorkerRefCount() override; | 107 void IncrementSharedWorkerRefCount() override; |
107 void DecrementSharedWorkerRefCount() override; | 108 void DecrementSharedWorkerRefCount() override; |
108 void ForceReleaseWorkerRefCounts() override; | 109 void ForceReleaseWorkerRefCounts() override; |
109 bool IsWorkerRefCountDisabled() override; | 110 bool IsWorkerRefCountDisabled() override; |
110 void PurgeAndSuspend() override; | 111 void PurgeAndSuspend() override; |
111 void Resume() override; | 112 void Resume() override; |
112 mojom::Renderer* GetRendererInterface() override; | 113 mojom::Renderer* GetRendererInterface() override; |
113 | 114 |
(...skipping 18 matching lines...) Expand all Loading... |
132 is_process_backgrounded_ = is_process_backgrounded; | 133 is_process_backgrounded_ = is_process_backgrounded; |
133 } | 134 } |
134 | 135 |
135 void SetProcessHandle(std::unique_ptr<base::ProcessHandle> new_handle) { | 136 void SetProcessHandle(std::unique_ptr<base::ProcessHandle> new_handle) { |
136 process_handle = std::move(new_handle); | 137 process_handle = std::move(new_handle); |
137 } | 138 } |
138 | 139 |
139 void GetAudioOutputControllers( | 140 void GetAudioOutputControllers( |
140 const GetAudioOutputControllersCallback& callback) const override {} | 141 const GetAudioOutputControllersCallback& callback) const override {} |
141 | 142 |
142 int worker_ref_count() const { return worker_ref_count_; } | |
143 | |
144 void SetRemoteInterfaces( | 143 void SetRemoteInterfaces( |
145 std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces) { | 144 std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces) { |
146 remote_interfaces_ = std::move(remote_interfaces); | 145 remote_interfaces_ = std::move(remote_interfaces); |
147 } | 146 } |
148 | 147 |
149 private: | 148 private: |
150 // Stores IPC messages that would have been sent to the renderer. | 149 // Stores IPC messages that would have been sent to the renderer. |
151 IPC::TestSink sink_; | 150 IPC::TestSink sink_; |
152 int bad_msg_count_; | 151 int bad_msg_count_; |
153 const MockRenderProcessHostFactory* factory_; | 152 const MockRenderProcessHostFactory* factory_; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // for deleting all MockRenderProcessHosts that have not deleted by a test in | 190 // for deleting all MockRenderProcessHosts that have not deleted by a test in |
192 // the destructor and prevent them from being leaked. | 191 // the destructor and prevent them from being leaked. |
193 mutable ScopedVector<MockRenderProcessHost> processes_; | 192 mutable ScopedVector<MockRenderProcessHost> processes_; |
194 | 193 |
195 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory); | 194 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory); |
196 }; | 195 }; |
197 | 196 |
198 } // namespace content | 197 } // namespace content |
199 | 198 |
200 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ | 199 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ |
OLD | NEW |