| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 ~MockRenderProcessHostFactory() override; | 193 ~MockRenderProcessHostFactory() override; |
| 194 | 194 |
| 195 RenderProcessHost* CreateRenderProcessHost( | 195 RenderProcessHost* CreateRenderProcessHost( |
| 196 BrowserContext* browser_context) const override; | 196 BrowserContext* browser_context) const override; |
| 197 | 197 |
| 198 // Removes the given MockRenderProcessHost from the MockRenderProcessHost list | 198 // Removes the given MockRenderProcessHost from the MockRenderProcessHost list |
| 199 // without deleting it. When a test deletes a MockRenderProcessHost, we need | 199 // without deleting it. When a test deletes a MockRenderProcessHost, we need |
| 200 // to remove it from |processes_| to prevent it from being deleted twice. | 200 // to remove it from |processes_| to prevent it from being deleted twice. |
| 201 void Remove(MockRenderProcessHost* host) const; | 201 void Remove(MockRenderProcessHost* host) const; |
| 202 | 202 |
| 203 // Retrieve the current list of mock processes. |
| 204 std::vector<std::unique_ptr<MockRenderProcessHost>>* GetProcesses() { |
| 205 return &processes_; |
| 206 } |
| 207 |
| 203 private: | 208 private: |
| 204 // A list of MockRenderProcessHosts created by this object. This list is used | 209 // A list of MockRenderProcessHosts created by this object. This list is used |
| 205 // for deleting all MockRenderProcessHosts that have not deleted by a test in | 210 // for deleting all MockRenderProcessHosts that have not deleted by a test in |
| 206 // the destructor and prevent them from being leaked. | 211 // the destructor and prevent them from being leaked. |
| 207 mutable std::vector<std::unique_ptr<MockRenderProcessHost>> processes_; | 212 mutable std::vector<std::unique_ptr<MockRenderProcessHost>> processes_; |
| 208 | 213 |
| 209 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory); | 214 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory); |
| 210 }; | 215 }; |
| 211 | 216 |
| 212 } // namespace content | 217 } // namespace content |
| 213 | 218 |
| 214 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ | 219 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ |
| OLD | NEW |