summaryrefslogtreecommitdiffstats
path: root/ui/ozone
diff options
context:
space:
mode:
authordnicoara <dnicoara@chromium.org>2015-02-12 07:27:03 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-12 15:27:46 +0000
commita17c85616644e8a6cca709bfe0eecb299e500ac1 (patch)
treef23c30ce75701f958d46c0716beebcf9d29fcb90 /ui/ozone
parent2b6b0628bd2800861a5575a4a47f7b0d3482e132 (diff)
downloadchromium_src-a17c85616644e8a6cca709bfe0eecb299e500ac1.zip
chromium_src-a17c85616644e8a6cca709bfe0eecb299e500ac1.tar.gz
chromium_src-a17c85616644e8a6cca709bfe0eecb299e500ac1.tar.bz2
[Ozone-Demo] Fix debug build
The GPU process operation to add message filters is expected to be on an IO message loop. This patch adds an IO helper thread to the UiThreadGpu to allow us to correctly initialize the message filters. BUG=none Review URL: https://codereview.chromium.org/916803004 Cr-Commit-Position: refs/heads/master@{#315979}
Diffstat (limited to 'ui/ozone')
-rw-r--r--ui/ozone/public/ui_thread_gpu.cc17
-rw-r--r--ui/ozone/public/ui_thread_gpu.h5
2 files changed, 19 insertions, 3 deletions
diff --git a/ui/ozone/public/ui_thread_gpu.cc b/ui/ozone/public/ui_thread_gpu.cc
index e64e13c..aeb08b1 100644
--- a/ui/ozone/public/ui_thread_gpu.cc
+++ b/ui/ozone/public/ui_thread_gpu.cc
@@ -28,14 +28,17 @@ class FakeGpuProcess : public IPC::Sender {
void Init() {
task_runner_ = base::ThreadTaskRunnerHandle::Get();
+
ui::OzonePlatform::GetInstance()
->GetGpuPlatformSupport()
- ->GetMessageFilter()
- ->OnFilterAdded(this);
+ ->OnChannelEstablished(this);
+ }
+ void InitOnIO() {
ui::OzonePlatform::GetInstance()
->GetGpuPlatformSupport()
- ->OnChannelEstablished(this);
+ ->GetMessageFilter()
+ ->OnFilterAdded(this);
}
bool Send(IPC::Message* msg) override {
@@ -96,7 +99,15 @@ UiThreadGpu::~UiThreadGpu() {
}
bool UiThreadGpu::Initialize() {
+ io_helper_thread_.reset(new base::Thread("IOHelperThread"));
+ if (!io_helper_thread_->StartWithOptions(
+ base::Thread::Options(base::MessageLoop::TYPE_IO, 0)))
+ return false;
+
fake_gpu_process_.reset(new FakeGpuProcess);
+ io_helper_thread_->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&FakeGpuProcess::InitOnIO,
+ base::Unretained(fake_gpu_process_.get())));
fake_gpu_process_->Init();
fake_gpu_process_host_.reset(new FakeGpuProcessHost);
diff --git a/ui/ozone/public/ui_thread_gpu.h b/ui/ozone/public/ui_thread_gpu.h
index 36c793e..4e75dab 100644
--- a/ui/ozone/public/ui_thread_gpu.h
+++ b/ui/ozone/public/ui_thread_gpu.h
@@ -8,6 +8,10 @@
#include "base/memory/scoped_ptr.h"
#include "ui/ozone/ozone_export.h"
+namespace base {
+class Thread;
+}
+
namespace ui {
class FakeGpuProcess;
@@ -28,6 +32,7 @@ class OZONE_EXPORT UiThreadGpu {
private:
scoped_ptr<FakeGpuProcess> fake_gpu_process_;
scoped_ptr<FakeGpuProcessHost> fake_gpu_process_host_;
+ scoped_ptr<base::Thread> io_helper_thread_;
DISALLOW_COPY_AND_ASSIGN(UiThreadGpu);
};