summaryrefslogtreecommitdiffstats
path: root/content/common/gpu/gpu_channel_test_common.cc
diff options
context:
space:
mode:
authorshrike <shrike@chromium.org>2016-02-24 16:12:38 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-25 00:13:54 +0000
commitd45509a44318afe5643302e0c1edcb3760d8b2fe (patch)
tree7e3298b3b0ad88f355de146e5728a310ff67e489 /content/common/gpu/gpu_channel_test_common.cc
parent4e143f588ee88f7e345abd261476f7721e48a428 (diff)
downloadchromium_src-d45509a44318afe5643302e0c1edcb3760d8b2fe.zip
chromium_src-d45509a44318afe5643302e0c1edcb3760d8b2fe.tar.gz
chromium_src-d45509a44318afe5643302e0c1edcb3760d8b2fe.tar.bz2
Revert of Decouple browser-specific GPU IPC messages from GPU service IPCs (patchset #19 id:360001 of https://codereview.chromium.org/1711533002/ )
Reason for revert: Regression: Win7 Tests (dbg)(1) browser_test failures https://build.chromium.org/p/chromium.win/builders/Win7%20Tests%20%28dbg%29%281%29 Sheriff-o-matic suspecting Change #198012 in Build 46233 for cause of Win7 Tests (dbg)(1) browser_test failures: https://build.chromium.org/p/chromium.win/builders/Win7%20Tests%20%28dbg%29%281%29/builds/46233 In step 91. browser_tests failures: DevToolsPixelOutputTests.TestLatencyInfoInstrumentation DevToolsPixelOutputTests.TestScreenshotRecording Logs: https://build.chromium.org/p/chromium.win/builders/Win7%20Tests%20%28dbg%29%281%29/builds/46233/steps/browser_tests%20on%20Windows-7-SP1/logs/DevToolsPixelOutputTests.TestLatencyInfoInstrumentation https://build.chromium.org/p/chromium.win/builders/Win7%20Tests%20%28dbg%29%281%29/builds/46233/steps/browser_tests%20on%20Windows-7-SP1/logs/DevToolsPixelOutputTests.TestScreenshotRecording [ RUN ] DevToolsPixelOutputTests.TestLatencyInfoInstrumentation [2840:5856:0224/124138:ERROR:angle_platform_impl.cc(33)] ANGLE Display::initialize error 4: Could not create D3D11 device. [2840:5856:0224/124138:ERROR:gl_surface_egl.cc(586)] eglInitialize D3D11 failed with error EGL_NOT_INITIALIZED, trying next display type [2840:5856:0224/124139:ERROR:angle_platform_impl.cc(33)] ANGLE Display::initialize error 4: Renderer does not support PS 3.0.aborting! [2840:5856:0224/124139:ERROR:gl_surface_egl.cc(586)] eglInitialize D3D9 failed with error EGL_NOT_INITIALIZED [2840:5856:0224/124139:ERROR:angle_platform_impl.cc(33)] ANGLE Display::initialize error 4: Could not create D3D11 device. [2840:5856:0224/124139:ERROR:gl_surface_egl.cc(586)] eglInitialize D3D11 failed with error EGL_NOT_INITIALIZED, trying next display type HTTP server started on http://127.0.0.1:58543... sending server_data: {"host": "127.0.0.1", "port": 58543} (36 bytes) [2840:5856:0224/124140:ERROR:angle_platform_impl.cc(33)] ANGLE Display::initialize error 4: Renderer does not support PS 3.0.aborting! [2840:5856:0224/124140:ERROR:gl_surface_egl.cc(586)] eglInitialize D3D9 failed with error EGL_NOT_INITIALIZED [2840:5856:0224/124140:ERROR:gl_surface_win.cc(69)] GLSurfaceEGL::InitializeOneOff failed. [2840:5856:0224/124140:ERROR:gpu_child_thread.cc(347)] Exiting GPU process due to errors during initialization [2840:5856:0224/124140:FATAL:gpu_child_thread.cc(484)] Check failed: gpu_channel_manager_. Backtrace: base::SysInfo::AmountOfVirtualMemory [0x100A8DB1+570092] base::SysInfo::AmountOfVirtualMemory [0x10100BCB+930054] content::ImageTransportFactory::ImageTransportFactory [0x176BA2F8+29889885] content::ImageTransportFactory::ImageTransportFactory [0x176B25D9+29857854] content::ImageTransportFactory::ImageTransportFactory [0x176B2118+29856637] content::ImageTransportFactory::ImageTransportFactory [0x176B23C6+29857323] content::ImageTransportFactory::ImageTransportFactory [0x176B141C+29853313] content::ImageTransportFactory::ImageTransportFactory [0x176BB492+29894391] IPC::Message::type [0x0FA2EA2B+166218] IPC::Message::type [0x0FA26F90+134831] IPC::Message::type [0x0FA26CE7+134150] IPC::Message::type [0x0FA2F6C2+169441] base::SysInfo::AmountOfVirtualMemory [0x1007C9BF+388858] base::SysInfo::AmountOfVirtualMemory [0x100AF147+595586] base::SysInfo::AmountOfVirtualMemory [0x1012E576+1116849] base::SysInfo::AmountOfVirtualMemory [0x1012BC74+1106351] base::SysInfo::AmountOfVirtualMemory [0x1012C43D+1108344] base::SysInfo::AmountOfVirtualMemory [0x10137E44+1155967] base::SysInfo::AmountOfVirtualMemory [0x10139E62+1164189] base::SysInfo::AmountOfVirtualMemory [0x10139DBC+1164023] base::SysInfo::AmountOfVirtualMemory [0x1012E1FF+1115962] base::SysInfo::AmountOfVirtualMemory [0x101C11C6+1718017] base::SysInfo::AmountOfVirtualMemory [0x1012E02D+1115496] content::ImageTransportFactory::ImageTransportFactory [0x176C0E20+29917317] content::ImageTransportFactory::ImageTransportFactory [0x15BEB179+1778654] content::ImageTransportFactory::ImageTransportFactory [0x15BEAF90+1778165] content::ImageTransportFactory::ImageTransportFactory [0x15BD4B70+1686997] content::LaunchTests [0x0849E65E+734] LaunchChromeTests [0x037F990D+125] main [0x01D5643E+110] __tmainCRTStartup [0x09B5DBE9+409] (f:\dd ctools\crt\crtw32\dllstuff\crtexe.c:626) mainCRTStartup [0x09B5DD2D+13] (f:\dd ctools\crt\crtw32\dllstuff\crtexe.c:466) BaseThreadInitThunk [0x767C337A+18] RtlInitializeExceptionChain [0x77D29882+99] RtlInitializeExceptionChain [0x77D29855+54] ================= [ RUN ] DevToolsPixelOutputTests.TestScreenshotRecording [2512:3528:0224/124026:ERROR:angle_platform_impl.cc(33)] ANGLE Display::initialize error 4: Could not create D3D11 device. [2512:3528:0224/124026:ERROR:gl_surface_egl.cc(586)] eglInitialize D3D11 failed with error EGL_NOT_INITIALIZED, trying next display type [2512:3528:0224/124026:ERROR:angle_platform_impl.cc(33)] ANGLE Display::initialize error 4: Renderer does not support PS 3.0.aborting! [2512:3528:0224/124026:ERROR:gl_surface_egl.cc(586)] eglInitialize D3D9 failed with error EGL_NOT_INITIALIZED [2512:3528:0224/124026:ERROR:angle_platform_impl.cc(33)] ANGLE Display::initialize error 4: Could not create D3D11 device. [2512:3528:0224/124026:ERROR:gl_surface_egl.cc(586)] eglInitialize D3D11 failed with error EGL_NOT_INITIALIZED, trying next display type [2512:3528:0224/124026:ERROR:angle_platform_impl.cc(33)] ANGLE Display::initialize error 4: Renderer does not support PS 3.0.aborting! [2512:3528:0224/124026:ERROR:gl_surface_egl.cc(586)] eglInitialize D3D9 failed with error EGL_NOT_INITIALIZED [2512:3528:0224/124026:ERROR:gl_surface_win.cc(69)] GLSurfaceEGL::InitializeOneOff failed. [2512:3528:0224/124026:ERROR:gpu_child_thread.cc(347)] Exiting GPU process due to errors during initialization HTTP server started on http://127.0.0.1:51161... sending server_data: {"host": "127.0.0.1", "port": 51161} (36 bytes) [4708:1384:0224/124028:WARNING:message_queue.cc(38)] Leaking 2 ports in unreceived messages [2512:3528:0224/124026:FATAL:gpu_child_thread.cc(484)] Check failed: gpu_channel_manager_. Backtrace: base::SysInfo::AmountOfVirtualMemory [0x100A8DB1+570092] base::SysInfo::AmountOfVirtualMemory [0x10100BCB+930054] content::ImageTransportFactory::ImageTransportFactory [0x1778A2F8+29889885] content::ImageTransportFactory::ImageTransportFactory [0x177825D9+29857854] content::ImageTransportFactory::ImageTransportFactory [0x17782118+29856637] content::ImageTransportFactory::ImageTransportFactory [0x177823C6+29857323] content::ImageTransportFactory::ImageTransportFactory [0x1778141C+29853313] content::ImageTransportFactory::ImageTransportFactory [0x1778B492+29894391] IPC::Message::type [0x0FAFEA2B+166218] IPC::Message::type [0x0FAF6F90+134831] IPC::Message::type [0x0FAF6CE7+134150] IPC::Message::type [0x0FAFF6C2+169441] base::SysInfo::AmountOfVirtualMemory [0x1007C9BF+388858] base::SysInfo::AmountOfVirtualMemory [0x100AF147+595586] base::SysInfo::AmountOfVirtualMemory [0x1012E576+1116849] base::SysInfo::AmountOfVirtualMemory [0x1012BC74+1106351] base::SysInfo::AmountOfVirtualMemory [0x1012C43D+1108344] base::SysInfo::AmountOfVirtualMemory [0x10137E44+1155967] base::SysInfo::AmountOfVirtualMemory [0x10139E62+1164189] base::SysInfo::AmountOfVirtualMemory [0x10139DBC+1164023] base::SysInfo::AmountOfVirtualMemory [0x1012E1FF+1115962] base::SysInfo::AmountOfVirtualMemory [0x101C11C6+1718017] base::SysInfo::AmountOfVirtualMemory [0x1012E02D+1115496] content::ImageTransportFactory::ImageTransportFactory [0x17790E20+29917317] content::ImageTransportFactory::ImageTransportFactory [0x15CBB179+1778654] content::ImageTransportFactory::ImageTransportFactory [0x15CBAF90+1778165] content::ImageTransportFactory::ImageTransportFactory [0x15CA4B70+1686997] content::LaunchTests [0x0849E65E+734] LaunchChromeTests [0x037F990D+125] main [0x01D5643E+110] __tmainCRTStartup [0x09B5DBE9+409] (f:\dd ctools\crt\crtw32\dllstuff\crtexe.c:626) mainCRTStartup [0x09B5DD2D+13] (f:\dd ctools\crt\crtw32\dllstuff\crtexe.c:466) BaseThreadInitThunk [0x76C2337A+18] RtlInitializeExceptionChain [0x778692B2+99] RtlInitializeExceptionChain [0x77869285+54] [3768:3420:0224/124033:ERROR:singleton_hwnd.cc(34)] Cannot create windows on non-UI thread! [4708:1384:0224/124034:ERROR:CONSOLE(72)] "Uncaught TypeError: Cannot read property 'addExtensions' of undefined", source: (72) [4708:1384:0224/124035:INFO:CONSOLE(1)] "DONE:performActionsInPage.1", source: (1) c:uild\slave\win_builder__dbg_uild\src\chromerowser\devtools\devtools_sanity_browsertest.cc(124): error: Value of: result Actual: "[FAILED] Expected: 'true', but was 'false'" Expected: "[OK]" [4708:1384:0224/124038:WARNING:url_request_context_getter.cc(42)] URLRequestContextGetter leaking due to no owning thread. [ FAILED ] DevToolsPixelOutputTests.TestScreenshotRecording, where TypeParam = and GetParam() = (12746 ms) Original issue's description: > Decouple browser-specific GPU IPC messages from GPU service IPCs > > We would like Mus to reuse GPU service IPC messages. However, > browser-specific<=>gpu messages don't necessarily > make sense in Mus+Ash. This CL decouples browser messages > from Gpu channel messages in the following ways: > > 1. Browser channel messages are moved to a gpu_host_messages.h file. > > 2. Browser channel message handling is moved entirely to GpuChildThread. > > 3. GpuChannelManager is decoupled from GpuChildThread by making > GpuChildThread a GpuChannelManagerDelegate. > > The intent here is for Mus to implement an alternative > GpuChannelManagerDelegate. > > BUG=586374 > > Committed: https://crrev.com/6904b50eb105956b954279f9632f680251e41aa7 > Cr-Commit-Position: refs/heads/master@{#377341} TBR=sievers@chromium.org,piman@chromium.org,markdittmer@chromium.org,tsepez@chromium.org,fsamuel@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=586374 Review URL: https://codereview.chromium.org/1730023004 Cr-Commit-Position: refs/heads/master@{#377431}
Diffstat (limited to 'content/common/gpu/gpu_channel_test_common.cc')
-rw-r--r--content/common/gpu/gpu_channel_test_common.cc86
1 files changed, 22 insertions, 64 deletions
diff --git a/content/common/gpu/gpu_channel_test_common.cc b/content/common/gpu/gpu_channel_test_common.cc
index ad83c2d..2e8be03 100644
--- a/content/common/gpu/gpu_channel_test_common.cc
+++ b/content/common/gpu/gpu_channel_test_common.cc
@@ -6,72 +6,25 @@
#include "base/test/test_simple_task_runner.h"
#include "base/thread_task_runner_handle.h"
-#include "content/common/gpu/gpu_channel_manager_delegate.h"
#include "gpu/command_buffer/service/sync_point_manager.h"
#include "ipc/ipc_test_sink.h"
namespace content {
-TestGpuChannelManagerDelegate::TestGpuChannelManagerDelegate() {}
-
-TestGpuChannelManagerDelegate::~TestGpuChannelManagerDelegate() {}
-
-void TestGpuChannelManagerDelegate::AddSubscription(int32_t client_id,
- unsigned int target) {}
-
-void TestGpuChannelManagerDelegate::ChannelEstablished(
- const IPC::ChannelHandle& channel_handle) {
- last_established_channel_handle_ = channel_handle;
-}
-
-void TestGpuChannelManagerDelegate::DidCreateOffscreenContext(
- const GURL& active_url) {}
-
-void TestGpuChannelManagerDelegate::DidDestroyChannel(int client_id) {}
-
-void TestGpuChannelManagerDelegate::DidDestroyOffscreenContext(
- const GURL& active_url) {}
-
-void TestGpuChannelManagerDelegate::DidLoseContext(
- bool offscreen,
- gpu::error::ContextLostReason reason,
- const GURL& active_url) {}
-
-void TestGpuChannelManagerDelegate::GpuMemoryUmaStats(
- const GPUMemoryUmaStats& params) {}
-
-void TestGpuChannelManagerDelegate::RemoveSubscription(int32_t client_id,
- unsigned int target) {}
-
-void TestGpuChannelManagerDelegate::StoreShaderToDisk(
- int32_t client_id,
- const std::string& key,
- const std::string& shader) {}
-
-#if defined(OS_MACOSX)
-void TestGpuChannelManagerDelegate::SendAcceleratedSurfaceBuffersSwapped(
- const AcceleratedSurfaceBuffersSwappedParams& params) {}
-#endif
-
-#if defined(OS_WIN)
-void TestGpuChannelManagerDelegate::SendAcceleratedSurfaceCreatedChildWindow(
- const gfx::PluginWindowHandle& parent_window,
- const gfx::PluginWindowHandle& child_window) {}
-#endif
-
TestGpuChannelManager::TestGpuChannelManager(
- GpuChannelManagerDelegate* delegate,
+ IPC::TestSink* sink,
base::SingleThreadTaskRunner* task_runner,
base::SingleThreadTaskRunner* io_task_runner,
gpu::SyncPointManager* sync_point_manager,
GpuMemoryBufferFactory* gpu_memory_buffer_factory)
- : GpuChannelManager(delegate,
+ : GpuChannelManager(nullptr,
nullptr,
task_runner,
io_task_runner,
nullptr,
sync_point_manager,
- gpu_memory_buffer_factory) {}
+ gpu_memory_buffer_factory),
+ sink_(sink) {}
TestGpuChannelManager::~TestGpuChannelManager() {
// Clear gpu channels here so that any IPC messages sent are handled using the
@@ -79,6 +32,10 @@ TestGpuChannelManager::~TestGpuChannelManager() {
gpu_channels_.clear();
}
+bool TestGpuChannelManager::Send(IPC::Message* msg) {
+ return sink_->Send(msg);
+}
+
scoped_ptr<GpuChannel> TestGpuChannelManager::CreateGpuChannel(
int client_id,
uint64_t client_tracing_id,
@@ -86,14 +43,15 @@ scoped_ptr<GpuChannel> TestGpuChannelManager::CreateGpuChannel(
bool allow_view_command_buffers,
bool allow_real_time_streams) {
return make_scoped_ptr(new TestGpuChannel(
- this, sync_point_manager(), share_group(), mailbox_manager(),
+ sink_, this, sync_point_manager(), share_group(), mailbox_manager(),
preempts ? preemption_flag() : nullptr,
preempts ? nullptr : preemption_flag(), task_runner_.get(),
io_task_runner_.get(), client_id, client_tracing_id,
allow_view_command_buffers, allow_real_time_streams));
}
-TestGpuChannel::TestGpuChannel(GpuChannelManager* gpu_channel_manager,
+TestGpuChannel::TestGpuChannel(IPC::TestSink* sink,
+ GpuChannelManager* gpu_channel_manager,
gpu::SyncPointManager* sync_point_manager,
gfx::GLShareGroup* share_group,
gpu::gles2::MailboxManager* mailbox_manager,
@@ -117,7 +75,8 @@ TestGpuChannel::TestGpuChannel(GpuChannelManager* gpu_channel_manager,
client_id,
client_tracing_id,
allow_view_command_buffers,
- allow_real_time_streams) {}
+ allow_real_time_streams),
+ sink_(sink) {}
TestGpuChannel::~TestGpuChannel() {
// Call stubs here so that any IPC messages sent are handled using the
@@ -130,27 +89,26 @@ base::ProcessId TestGpuChannel::GetClientPID() const {
}
IPC::ChannelHandle TestGpuChannel::Init(base::WaitableEvent* shutdown_event) {
- filter_->OnFilterAdded(&sink_);
+ filter_->OnFilterAdded(sink_);
return IPC::ChannelHandle(channel_id());
}
bool TestGpuChannel::Send(IPC::Message* msg) {
DCHECK(!msg->is_sync());
- return sink_.Send(msg);
+ return sink_->Send(msg);
}
// TODO(sunnyps): Use a mock memory buffer factory when necessary.
GpuChannelTestCommon::GpuChannelTestCommon()
- : task_runner_(new base::TestSimpleTaskRunner),
+ : sink_(new IPC::TestSink),
+ task_runner_(new base::TestSimpleTaskRunner),
io_task_runner_(new base::TestSimpleTaskRunner),
sync_point_manager_(new gpu::SyncPointManager(false)),
- channel_manager_delegate_(new TestGpuChannelManagerDelegate()),
- channel_manager_(
- new TestGpuChannelManager(channel_manager_delegate_.get(),
- task_runner_.get(),
- io_task_runner_.get(),
- sync_point_manager_.get(),
- nullptr)) {}
+ channel_manager_(new TestGpuChannelManager(sink_.get(),
+ task_runner_.get(),
+ io_task_runner_.get(),
+ sync_point_manager_.get(),
+ nullptr)) {}
GpuChannelTestCommon::~GpuChannelTestCommon() {
// Destroying channels causes tasks to run on the IO task runner.