| Index: content/browser/gpu/browser_gpu_channel_host_factory.cc
|
| diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc
|
| index 9edb9677c56abc2b4801d5aa62193d362236b95c..d7c34f5f8c9abea664e7c3b63ea84812379d2d54 100644
|
| --- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
|
| +++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
|
| @@ -281,6 +281,7 @@ uint32 BrowserGpuChannelHostFactory::GetImageTextureTarget() {
|
|
|
| BrowserGpuChannelHostFactory::BrowserGpuChannelHostFactory()
|
| : gpu_client_id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()),
|
| + main_task_runner_(base::MessageLoopProxy::current()),
|
| shutdown_event_(new base::WaitableEvent(true, false)),
|
| gpu_memory_buffer_manager_(
|
| new BrowserGpuMemoryBufferManager(this, gpu_client_id_)),
|
| @@ -289,7 +290,7 @@ BrowserGpuChannelHostFactory::BrowserGpuChannelHostFactory()
|
| }
|
|
|
| BrowserGpuChannelHostFactory::~BrowserGpuChannelHostFactory() {
|
| - DCHECK(IsMainThread());
|
| + DCHECK(main_task_runner_->BelongsToCurrentThread());
|
| if (pending_request_.get())
|
| pending_request_->Cancel();
|
| for (size_t n = 0; n < established_callbacks_.size(); n++)
|
| @@ -297,12 +298,9 @@ BrowserGpuChannelHostFactory::~BrowserGpuChannelHostFactory() {
|
| shutdown_event_->Signal();
|
| }
|
|
|
| -bool BrowserGpuChannelHostFactory::IsMainThread() {
|
| - return BrowserThread::CurrentlyOn(BrowserThread::UI);
|
| -}
|
| -
|
| -base::MessageLoop* BrowserGpuChannelHostFactory::GetMainLoop() {
|
| - return BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::UI);
|
| +scoped_refptr<base::SingleThreadTaskRunner>
|
| +BrowserGpuChannelHostFactory::GetMainTaskRunner() {
|
| + return main_task_runner_;
|
| }
|
|
|
| scoped_refptr<base::MessageLoopProxy>
|
| @@ -421,7 +419,7 @@ GpuChannelHost* BrowserGpuChannelHostFactory::GetGpuChannel() {
|
| }
|
|
|
| void BrowserGpuChannelHostFactory::GpuChannelEstablished() {
|
| - DCHECK(IsMainThread());
|
| + DCHECK(main_task_runner_->BelongsToCurrentThread());
|
| DCHECK(pending_request_.get());
|
| if (pending_request_->channel_handle().name.empty()) {
|
| DCHECK(!gpu_channel_.get());
|
|
|