| 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 <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
| 14 #include "base/metrics/persistent_memory_allocator.h" | 14 #include "base/metrics/persistent_memory_allocator.h" |
| 15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "content/browser/renderer_host/media/audio_renderer_host.h" |
| 16 #include "content/public/browser/render_process_host.h" | 17 #include "content/public/browser/render_process_host.h" |
| 17 #include "content/public/browser/render_process_host_factory.h" | 18 #include "content/public/browser/render_process_host_factory.h" |
| 18 #include "content/public/common/service_registry.h" | 19 #include "content/public/common/service_registry.h" |
| 19 #include "ipc/ipc_test_sink.h" | 20 #include "ipc/ipc_test_sink.h" |
| 20 | 21 |
| 21 class StoragePartition; | 22 class StoragePartition; |
| 22 | 23 |
| 23 namespace content { | 24 namespace content { |
| 24 | 25 |
| 25 class MockRenderProcessHostFactory; | 26 class MockRenderProcessHostFactory; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 void DecrementWorkerRefCount() override; | 108 void DecrementWorkerRefCount() override; |
| 108 void PurgeAndSuspend() override; | 109 void PurgeAndSuspend() override; |
| 109 | 110 |
| 110 // IPC::Sender via RenderProcessHost. | 111 // IPC::Sender via RenderProcessHost. |
| 111 bool Send(IPC::Message* msg) override; | 112 bool Send(IPC::Message* msg) override; |
| 112 | 113 |
| 113 // IPC::Listener via RenderProcessHost. | 114 // IPC::Listener via RenderProcessHost. |
| 114 bool OnMessageReceived(const IPC::Message& msg) override; | 115 bool OnMessageReceived(const IPC::Message& msg) override; |
| 115 void OnChannelConnected(int32_t peer_pid) override; | 116 void OnChannelConnected(int32_t peer_pid) override; |
| 116 | 117 |
| 118 scoped_refptr<AudioRendererHost> audio_renderer_host() const override; |
| 119 |
| 117 // Attaches the factory object so we can remove this object in its destructor | 120 // Attaches the factory object so we can remove this object in its destructor |
| 118 // and prevent MockRenderProcessHostFacotry from deleting it. | 121 // and prevent MockRenderProcessHostFacotry from deleting it. |
| 119 void SetFactory(const MockRenderProcessHostFactory* factory) { | 122 void SetFactory(const MockRenderProcessHostFactory* factory) { |
| 120 factory_ = factory; | 123 factory_ = factory; |
| 121 } | 124 } |
| 122 | 125 |
| 123 void set_is_for_guests_only(bool is_for_guests_only) { | 126 void set_is_for_guests_only(bool is_for_guests_only) { |
| 124 is_for_guests_only_ = is_for_guests_only; | 127 is_for_guests_only_ = is_for_guests_only; |
| 125 } | 128 } |
| 126 | 129 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // for deleting all MockRenderProcessHosts that have not deleted by a test in | 187 // for deleting all MockRenderProcessHosts that have not deleted by a test in |
| 185 // the destructor and prevent them from being leaked. | 188 // the destructor and prevent them from being leaked. |
| 186 mutable ScopedVector<MockRenderProcessHost> processes_; | 189 mutable ScopedVector<MockRenderProcessHost> processes_; |
| 187 | 190 |
| 188 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory); | 191 DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory); |
| 189 }; | 192 }; |
| 190 | 193 |
| 191 } // namespace content | 194 } // namespace content |
| 192 | 195 |
| 193 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ | 196 #endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_PROCESS_HOST_H_ |
| OLD | NEW |