| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/gpu/browser_gpu_channel_host_factory.h" | 5 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
| 10 #include "content/browser/gpu/gpu_data_manager_impl.h" | 10 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 } | 347 } |
| 348 | 348 |
| 349 void BrowserGpuChannelHostFactory::GpuChannelEstablished() { | 349 void BrowserGpuChannelHostFactory::GpuChannelEstablished() { |
| 350 DCHECK(IsMainThread()); | 350 DCHECK(IsMainThread()); |
| 351 DCHECK(pending_request_); | 351 DCHECK(pending_request_); |
| 352 if (pending_request_->channel_handle().name.empty()) | 352 if (pending_request_->channel_handle().name.empty()) |
| 353 return; | 353 return; |
| 354 | 354 |
| 355 GetContentClient()->SetGpuInfo(pending_request_->gpu_info()); | 355 GetContentClient()->SetGpuInfo(pending_request_->gpu_info()); |
| 356 gpu_channel_ = GpuChannelHost::Create(this, | 356 gpu_channel_ = GpuChannelHost::Create(this, |
| 357 pending_request_->gpu_host_id(), | |
| 358 pending_request_->gpu_info(), | 357 pending_request_->gpu_info(), |
| 359 pending_request_->channel_handle()); | 358 pending_request_->channel_handle()); |
| 360 gpu_host_id_ = pending_request_->gpu_host_id(); | 359 gpu_host_id_ = pending_request_->gpu_host_id(); |
| 361 pending_request_ = NULL; | 360 pending_request_ = NULL; |
| 362 | 361 |
| 363 for (size_t n = 0; n < established_callbacks_.size(); n++) | 362 for (size_t n = 0; n < established_callbacks_.size(); n++) |
| 364 established_callbacks_[n].Run(); | 363 established_callbacks_[n].Run(); |
| 365 | 364 |
| 366 established_callbacks_.clear(); | 365 established_callbacks_.clear(); |
| 367 } | 366 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 filter->AddRoute(MSG_ROUTING_CONTROL, handler); | 415 filter->AddRoute(MSG_ROUTING_CONTROL, handler); |
| 417 | 416 |
| 418 GetIOLoopProxy()->PostTask( | 417 GetIOLoopProxy()->PostTask( |
| 419 FROM_HERE, | 418 FROM_HERE, |
| 420 base::Bind(&BrowserGpuChannelHostFactory::AddFilterOnIO, | 419 base::Bind(&BrowserGpuChannelHostFactory::AddFilterOnIO, |
| 421 gpu_host_id_, | 420 gpu_host_id_, |
| 422 filter)); | 421 filter)); |
| 423 } | 422 } |
| 424 | 423 |
| 425 } // namespace content | 424 } // namespace content |
| OLD | NEW |