Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: content/renderer/render_thread_impl_browsertest.cc

Issue 2680973006: Mojo EDK: Add safe process connection API (Closed)
Patch Set: . Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/public/common/child_process_host.h ('k') | mojo/edk/embedder/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
(...skipping 26 matching lines...) Expand all
37 #include "content/public/test/test_launcher.h" 37 #include "content/public/test/test_launcher.h"
38 #include "content/public/test/test_service_manager_context.h" 38 #include "content/public/test/test_service_manager_context.h"
39 #include "content/renderer/render_process_impl.h" 39 #include "content/renderer/render_process_impl.h"
40 #include "content/test/mock_render_process.h" 40 #include "content/test/mock_render_process.h"
41 #include "gpu/GLES2/gl2extchromium.h" 41 #include "gpu/GLES2/gl2extchromium.h"
42 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" 42 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
43 #include "gpu/ipc/host/gpu_switches.h" 43 #include "gpu/ipc/host/gpu_switches.h"
44 #include "ipc/ipc.mojom.h" 44 #include "ipc/ipc.mojom.h"
45 #include "ipc/ipc_channel_mojo.h" 45 #include "ipc/ipc_channel_mojo.h"
46 #include "mojo/edk/embedder/embedder.h" 46 #include "mojo/edk/embedder/embedder.h"
47 #include "mojo/edk/embedder/pending_process_connection.h"
47 #include "testing/gtest/include/gtest/gtest.h" 48 #include "testing/gtest/include/gtest/gtest.h"
48 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul er.h" 49 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul er.h"
49 #include "ui/gfx/buffer_format_util.h" 50 #include "ui/gfx/buffer_format_util.h"
50 51
51 // IPC messages for testing ---------------------------------------------------- 52 // IPC messages for testing ----------------------------------------------------
52 53
53 // TODO(mdempsky): Fix properly by moving into a separate 54 // TODO(mdempsky): Fix properly by moving into a separate
54 // browsertest_message_generator.cc file. 55 // browsertest_message_generator.cc file.
55 #undef IPC_IPC_MESSAGE_MACROS_H_ 56 #undef IPC_IPC_MESSAGE_MACROS_H_
56 #undef IPC_MESSAGE_EXTRA 57 #undef IPC_MESSAGE_EXTRA
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 content_renderer_client_.reset(new ContentRendererClient()); 173 content_renderer_client_.reset(new ContentRendererClient());
173 SetRendererClientForTesting(content_renderer_client_.get()); 174 SetRendererClientForTesting(content_renderer_client_.get());
174 175
175 browser_threads_.reset( 176 browser_threads_.reset(
176 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)); 177 new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP));
177 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = 178 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner =
178 base::ThreadTaskRunnerHandle::Get(); 179 base::ThreadTaskRunnerHandle::Get();
179 180
180 InitializeMojo(); 181 InitializeMojo();
181 shell_context_.reset(new TestServiceManagerContext); 182 shell_context_.reset(new TestServiceManagerContext);
183 mojo::edk::PendingProcessConnection process_connection;
182 child_connection_.reset(new ChildConnection( 184 child_connection_.reset(new ChildConnection(
183 mojom::kRendererServiceName, "test", mojo::edk::GenerateRandomToken(), 185 mojom::kRendererServiceName, "test", &process_connection,
184 ServiceManagerConnection::GetForProcess()->GetConnector(), 186 ServiceManagerConnection::GetForProcess()->GetConnector(),
185 io_task_runner)); 187 io_task_runner));
186 188
187 mojo::MessagePipe pipe; 189 mojo::MessagePipe pipe;
188 IPC::mojom::ChannelBootstrapPtr channel_bootstrap; 190 IPC::mojom::ChannelBootstrapPtr channel_bootstrap;
189 child_connection_->GetRemoteInterfaces()->GetInterface(&channel_bootstrap); 191 child_connection_->GetRemoteInterfaces()->GetInterface(&channel_bootstrap);
190 192
191 channel_ = IPC::ChannelProxy::Create( 193 channel_ = IPC::ChannelProxy::Create(
192 IPC::ChannelMojo::CreateServerFactory( 194 IPC::ChannelMojo::CreateServerFactory(
193 channel_bootstrap.PassInterface().PassHandle(), io_task_runner), 195 channel_bootstrap.PassInterface().PassHandle(), io_task_runner),
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 // These formats are guaranteed to work on all platforms. 385 // These formats are guaranteed to work on all platforms.
384 ::testing::Values(gfx::BufferFormat::R_8, 386 ::testing::Values(gfx::BufferFormat::R_8,
385 gfx::BufferFormat::BGR_565, 387 gfx::BufferFormat::BGR_565,
386 gfx::BufferFormat::RGBA_4444, 388 gfx::BufferFormat::RGBA_4444,
387 gfx::BufferFormat::RGBA_8888, 389 gfx::BufferFormat::RGBA_8888,
388 gfx::BufferFormat::BGRA_8888, 390 gfx::BufferFormat::BGRA_8888,
389 gfx::BufferFormat::YVU_420))); 391 gfx::BufferFormat::YVU_420)));
390 392
391 } // namespace 393 } // namespace
392 } // namespace content 394 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/child_process_host.h ('k') | mojo/edk/embedder/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698