diff options
author | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-12 22:51:10 +0000 |
---|---|---|
committer | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-12 22:51:10 +0000 |
commit | 4fc7cc52d49f4de12f17a1254674b4dfc449d035 (patch) | |
tree | cb345abfb4fb3382d21ec8fb3cb954f4aa7b0da0 | |
parent | cdead512de944e9283d9f6010bd4e1a7ffe643c4 (diff) | |
download | chromium_src-4fc7cc52d49f4de12f17a1254674b4dfc449d035.zip chromium_src-4fc7cc52d49f4de12f17a1254674b4dfc449d035.tar.gz chromium_src-4fc7cc52d49f4de12f17a1254674b4dfc449d035.tar.bz2 |
Use an X event loop in the GPU process on Linux.
In future patches, X windows will be created in the GPU
process, and events sent to these windows will need to
be forwarded to their parent windows.
Linux uses GTK as the default UI event loop type, but
GTK is not in the GPU process, so the X11 event loop
type is used instead.
Update package dependencies.
This will cause a regression in nacl_helper-text/text. Test
expectations will need to be updated.
BUG=145600
TBR=thakis, piman, mmoss, erg
Review URL: https://chromiumcodereview.appspot.com/23530050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222894 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/message_loop/message_loop.cc | 4 | ||||
-rw-r--r-- | base/message_loop/message_loop.h | 20 | ||||
-rw-r--r-- | base/message_loop/message_pump_x11.cc | 8 | ||||
-rw-r--r-- | base/message_loop/message_pump_x11.h | 4 | ||||
-rw-r--r-- | chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc | 3 | ||||
-rw-r--r-- | chrome/installer/linux/debian/expected_deps | 1 | ||||
-rw-r--r-- | chrome/installer/linux/rpm/expected_deps_i386 | 1 | ||||
-rw-r--r-- | chrome/installer/linux/rpm/expected_deps_x86_64 | 1 | ||||
-rw-r--r-- | content/gpu/gpu_main.cc | 2 |
9 files changed, 39 insertions, 5 deletions
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc index cdd8721..87a0b63 100644 --- a/base/message_loop/message_loop.cc +++ b/base/message_loop/message_loop.cc @@ -184,6 +184,10 @@ MessageLoop::MessageLoop(Type type) pump_.reset(MESSAGE_PUMP_UI); } else if (type_ == TYPE_IO) { pump_.reset(MESSAGE_PUMP_IO); +#if defined(TOOLKIT_GTK) + } else if (type_ == TYPE_GPU) { + pump_.reset(new MessagePumpX11()); +#endif #if defined(OS_ANDROID) } else if (type_ == TYPE_JAVA) { pump_.reset(MESSAGE_PUMP_UI); diff --git a/base/message_loop/message_loop.h b/base/message_loop/message_loop.h index bdad1b2..3520b72 100644 --- a/base/message_loop/message_loop.h +++ b/base/message_loop/message_loop.h @@ -42,6 +42,9 @@ #else #define USE_GTK_MESSAGE_PUMP #include "base/message_loop/message_pump_gtk.h" +#if defined(TOOLKIT_GTK) +#include "base/message_loop/message_pump_x11.h" +#endif #endif #endif @@ -110,6 +113,11 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate { // This type of ML also supports native UI events (e.g., Windows messages). // See also MessageLoopForUI. // + // TYPE_GPU + // This type of ML also supports native UI events for use in the GPU + // process. On Linux this will always be an X11 ML (as compared with the + // sometimes-GTK ML in the browser process). + // // TYPE_IO // This type of ML also supports asynchronous IO. See also // MessageLoopForIO. @@ -123,6 +131,9 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate { enum Type { TYPE_DEFAULT, TYPE_UI, +#if defined(TOOLKIT_GTK) + TYPE_GPU, +#endif TYPE_IO, #if defined(OS_ANDROID) TYPE_JAVA, @@ -416,6 +427,13 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate { MessagePumpLibevent* pump_libevent() { return static_cast<MessagePumpLibevent*>(pump_.get()); } +#if defined(TOOLKIT_GTK) + friend class MessagePumpX11; + MessagePumpX11* pump_gpu() { + DCHECK_EQ(TYPE_GPU, type()); + return static_cast<MessagePumpX11*>(pump_.get()); + } +#endif #endif scoped_ptr<MessagePump> pump_; @@ -599,7 +617,7 @@ class BASE_EXPORT MessageLoopForUI : public MessageLoop { #endif protected: -#if defined(USE_AURA) && defined(USE_X11) && !defined(OS_NACL) +#if defined(USE_X11) friend class MessagePumpX11; #endif #if defined(USE_OZONE) && !defined(OS_NACL) diff --git a/base/message_loop/message_pump_x11.cc b/base/message_loop/message_pump_x11.cc index 7e780b2..dd8b965e 100644 --- a/base/message_loop/message_pump_x11.cc +++ b/base/message_loop/message_pump_x11.cc @@ -158,7 +158,13 @@ bool MessagePumpX11::HasXInput2() { return InitializeXInput2(); } -#if !defined(TOOLKIT_GTK) +#if defined(TOOLKIT_GTK) +// static +MessagePumpX11* MessagePumpX11::Current() { + MessageLoop* loop = MessageLoop::current(); + return static_cast<MessagePumpX11*>(loop->pump_gpu()); +} +#else // static MessagePumpX11* MessagePumpX11::Current() { MessageLoopForUI* loop = MessageLoopForUI::current(); diff --git a/base/message_loop/message_pump_x11.h b/base/message_loop/message_pump_x11.h index 6f2c609..f1f678a 100644 --- a/base/message_loop/message_pump_x11.h +++ b/base/message_loop/message_pump_x11.h @@ -43,10 +43,8 @@ class BASE_EXPORT MessagePumpX11 : public MessagePumpGlib, // Returns true if the system supports XINPUT2. static bool HasXInput2(); -#if !defined(TOOLKIT_GTK) - // Returns the UI message pump. + // Returns the UI or GPU message pump. static MessagePumpX11* Current(); -#endif // Adds/Removes |dispatcher| for the |xid|. This will route all messages from // the window |xid| to |dispatcher. diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc index 58791d1..75b24ac 100644 --- a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc +++ b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc @@ -286,6 +286,9 @@ class TestMessageLoop : public base::MessageLoop { virtual ~TestMessageLoop() {} virtual bool IsType(base::MessageLoop::Type type) const OVERRIDE { switch (type) { +#if defined(TOOLKIT_GTK) + case base::MessageLoop::TYPE_GPU: +#endif case base::MessageLoop::TYPE_UI: return BrowserThread::CurrentlyOn(BrowserThread::UI); case base::MessageLoop::TYPE_IO: diff --git a/chrome/installer/linux/debian/expected_deps b/chrome/installer/linux/debian/expected_deps index f545951..5bff0b4 100644 --- a/chrome/installer/linux/debian/expected_deps +++ b/chrome/installer/linux/debian/expected_deps @@ -24,6 +24,7 @@ libxcomposite1 (>= 1:0.3-1) libxdamage1 (>= 1:1.1) libxext6 libxfixes3 +libxi6 (>= 2:1.2.99.4) libxrender1 libxss1 libxtst6 diff --git a/chrome/installer/linux/rpm/expected_deps_i386 b/chrome/installer/linux/rpm/expected_deps_i386 index b2d7944..8401dcf 100644 --- a/chrome/installer/linux/rpm/expected_deps_i386 +++ b/chrome/installer/linux/rpm/expected_deps_i386 @@ -68,6 +68,7 @@ libXcomposite.so.1 libXdamage.so.1 libXext.so.6 libXfixes.so.3 +libXi.so.6 libXrender.so.1 libXss.so.1 libXtst.so.6 diff --git a/chrome/installer/linux/rpm/expected_deps_x86_64 b/chrome/installer/linux/rpm/expected_deps_x86_64 index 0d0fac3..bfd60cd 100644 --- a/chrome/installer/linux/rpm/expected_deps_x86_64 +++ b/chrome/installer/linux/rpm/expected_deps_x86_64 @@ -58,6 +58,7 @@ libXcomposite.so.1()(64bit) libXdamage.so.1()(64bit) libXext.so.6()(64bit) libXfixes.so.3()(64bit) +libXi.so.6()(64bit) libXrender.so.1()(64bit) libXss.so.1()(64bit) libXtst.so.6()(64bit) diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc index da063d8..9e29e03 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc @@ -146,6 +146,8 @@ int GpuMain(const MainFunctionParams& parameters) { gfx::kGLImplementationDesktopName) { message_loop_type = base::MessageLoop::TYPE_UI; } +#elif defined(TOOLKIT_GTK) + message_loop_type = base::MessageLoop::TYPE_GPU; #elif defined(OS_LINUX) message_loop_type = base::MessageLoop::TYPE_DEFAULT; #endif |