OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/memory/discardable_memory.h" | 14 #include "base/memory/discardable_memory.h" |
15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
18 #include "base/threading/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
19 #include "cc/output/buffer_to_texture_target_map.h" | 19 #include "cc/output/buffer_to_texture_target_map.h" |
20 #include "content/app/mojo/mojo_init.h" | 20 #include "content/app/mojo/mojo_init.h" |
21 #include "content/child/child_gpu_memory_buffer_manager.h" | 21 #include "content/child/child_gpu_memory_buffer_manager.h" |
22 #include "content/common/in_process_child_thread_params.h" | 22 #include "content/common/in_process_child_thread_params.h" |
23 #include "content/common/mojo/mojo_child_connection.h" | |
24 #include "content/common/resource_messages.h" | 23 #include "content/common/resource_messages.h" |
| 24 #include "content/common/service_manager/child_connection.h" |
25 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
26 #include "content/public/browser/content_browser_client.h" | 26 #include "content/public/browser/content_browser_client.h" |
27 #include "content/public/common/content_client.h" | 27 #include "content/public/common/content_client.h" |
28 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
29 #include "content/public/common/mojo_shell_connection.h" | 29 #include "content/public/common/service_manager_connection.h" |
30 #include "content/public/common/service_names.h" | 30 #include "content/public/common/service_names.h" |
31 #include "content/public/renderer/content_renderer_client.h" | 31 #include "content/public/renderer/content_renderer_client.h" |
32 #include "content/public/test/content_browser_test.h" | 32 #include "content/public/test/content_browser_test.h" |
33 #include "content/public/test/content_browser_test_utils.h" | 33 #include "content/public/test/content_browser_test_utils.h" |
34 #include "content/public/test/test_browser_thread_bundle.h" | 34 #include "content/public/test/test_browser_thread_bundle.h" |
35 #include "content/public/test/test_content_client_initializer.h" | 35 #include "content/public/test/test_content_client_initializer.h" |
36 #include "content/public/test/test_service_manager_context.h" | 36 #include "content/public/test/test_service_manager_context.h" |
37 #include "content/renderer/render_process_impl.h" | 37 #include "content/renderer/render_process_impl.h" |
38 #include "content/test/mock_render_process.h" | 38 #include "content/test/mock_render_process.h" |
39 #include "gpu/GLES2/gl2extchromium.h" | 39 #include "gpu/GLES2/gl2extchromium.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 SetRendererClientForTesting(content_renderer_client_.get()); | 171 SetRendererClientForTesting(content_renderer_client_.get()); |
172 | 172 |
173 browser_threads_.reset( | 173 browser_threads_.reset( |
174 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)); | 174 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)); |
175 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 175 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
176 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); | 176 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO); |
177 | 177 |
178 InitializeMojo(); | 178 InitializeMojo(); |
179 ipc_support_.reset(new mojo::edk::test::ScopedIPCSupport(io_task_runner)); | 179 ipc_support_.reset(new mojo::edk::test::ScopedIPCSupport(io_task_runner)); |
180 shell_context_.reset(new TestServiceManagerContext); | 180 shell_context_.reset(new TestServiceManagerContext); |
181 child_connection_.reset(new MojoChildConnection( | 181 child_connection_.reset(new ChildConnection( |
182 kRendererMojoApplicationName, "test", mojo::edk::GenerateRandomToken(), | 182 kRendererServiceName, "test", mojo::edk::GenerateRandomToken(), |
183 MojoShellConnection::GetForProcess()->GetConnector(), io_task_runner)); | 183 ServiceManagerConnection::GetForProcess()->GetConnector(), |
| 184 io_task_runner)); |
184 | 185 |
185 mojo::MessagePipe pipe; | 186 mojo::MessagePipe pipe; |
186 IPC::mojom::ChannelBootstrapPtr channel_bootstrap; | 187 IPC::mojom::ChannelBootstrapPtr channel_bootstrap; |
187 child_connection_->GetRemoteInterfaces()->GetInterface(&channel_bootstrap); | 188 child_connection_->GetRemoteInterfaces()->GetInterface(&channel_bootstrap); |
188 | 189 |
189 dummy_listener_.reset(new DummyListener); | 190 dummy_listener_.reset(new DummyListener); |
190 channel_ = IPC::ChannelProxy::Create( | 191 channel_ = IPC::ChannelProxy::Create( |
191 IPC::ChannelMojo::CreateServerFactory( | 192 IPC::ChannelMojo::CreateServerFactory( |
192 channel_bootstrap.PassInterface().PassHandle(), io_task_runner), | 193 channel_bootstrap.PassInterface().PassHandle(), io_task_runner), |
193 dummy_listener_.get(), io_task_runner); | 194 dummy_listener_.get(), io_task_runner); |
(...skipping 28 matching lines...) Expand all Loading... |
222 | 223 |
223 IPC::Sender* sender() { return channel_.get(); } | 224 IPC::Sender* sender() { return channel_.get(); } |
224 | 225 |
225 scoped_refptr<TestTaskCounter> test_task_counter_; | 226 scoped_refptr<TestTaskCounter> test_task_counter_; |
226 TestContentClientInitializer content_client_initializer_; | 227 TestContentClientInitializer content_client_initializer_; |
227 std::unique_ptr<ContentRendererClient> content_renderer_client_; | 228 std::unique_ptr<ContentRendererClient> content_renderer_client_; |
228 | 229 |
229 std::unique_ptr<TestBrowserThreadBundle> browser_threads_; | 230 std::unique_ptr<TestBrowserThreadBundle> browser_threads_; |
230 std::unique_ptr<mojo::edk::test::ScopedIPCSupport> ipc_support_; | 231 std::unique_ptr<mojo::edk::test::ScopedIPCSupport> ipc_support_; |
231 std::unique_ptr<TestServiceManagerContext> shell_context_; | 232 std::unique_ptr<TestServiceManagerContext> shell_context_; |
232 std::unique_ptr<MojoChildConnection> child_connection_; | 233 std::unique_ptr<ChildConnection> child_connection_; |
233 std::unique_ptr<DummyListener> dummy_listener_; | 234 std::unique_ptr<DummyListener> dummy_listener_; |
234 std::unique_ptr<IPC::ChannelProxy> channel_; | 235 std::unique_ptr<IPC::ChannelProxy> channel_; |
235 | 236 |
236 std::unique_ptr<MockRenderProcess> mock_process_; | 237 std::unique_ptr<MockRenderProcess> mock_process_; |
237 scoped_refptr<QuitOnTestMsgFilter> test_msg_filter_; | 238 scoped_refptr<QuitOnTestMsgFilter> test_msg_filter_; |
238 RenderThreadImplForTest* thread_; // Owned by mock_process_. | 239 RenderThreadImplForTest* thread_; // Owned by mock_process_. |
239 }; | 240 }; |
240 | 241 |
241 void CheckRenderThreadInputHandlerManager(RenderThreadImpl* thread) { | 242 void CheckRenderThreadInputHandlerManager(RenderThreadImpl* thread) { |
242 ASSERT_TRUE(thread->input_handler_manager()); | 243 ASSERT_TRUE(thread->input_handler_manager()); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 // These formats are guaranteed to work on all platforms. | 374 // These formats are guaranteed to work on all platforms. |
374 ::testing::Values(gfx::BufferFormat::R_8, | 375 ::testing::Values(gfx::BufferFormat::R_8, |
375 gfx::BufferFormat::BGR_565, | 376 gfx::BufferFormat::BGR_565, |
376 gfx::BufferFormat::RGBA_4444, | 377 gfx::BufferFormat::RGBA_4444, |
377 gfx::BufferFormat::RGBA_8888, | 378 gfx::BufferFormat::RGBA_8888, |
378 gfx::BufferFormat::BGRA_8888, | 379 gfx::BufferFormat::BGRA_8888, |
379 gfx::BufferFormat::YVU_420))); | 380 gfx::BufferFormat::YVU_420))); |
380 | 381 |
381 } // namespace | 382 } // namespace |
382 } // namespace content | 383 } // namespace content |
OLD | NEW |