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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 } | 352 } |
353 | 353 |
354 void BrowserGpuChannelHostFactory::GpuChannelEstablished() { | 354 void BrowserGpuChannelHostFactory::GpuChannelEstablished() { |
355 DCHECK(IsMainThread()); | 355 DCHECK(IsMainThread()); |
356 DCHECK(pending_request_); | 356 DCHECK(pending_request_); |
357 if (pending_request_->channel_handle().name.empty()) | 357 if (pending_request_->channel_handle().name.empty()) |
358 return; | 358 return; |
359 | 359 |
360 GetContentClient()->SetGpuInfo(pending_request_->gpu_info()); | 360 GetContentClient()->SetGpuInfo(pending_request_->gpu_info()); |
361 gpu_channel_ = GpuChannelHost::Create(this, | 361 gpu_channel_ = GpuChannelHost::Create(this, |
362 pending_request_->gpu_host_id(), | |
363 pending_request_->gpu_info(), | 362 pending_request_->gpu_info(), |
364 pending_request_->channel_handle()); | 363 pending_request_->channel_handle()); |
365 gpu_host_id_ = pending_request_->gpu_host_id(); | 364 gpu_host_id_ = pending_request_->gpu_host_id(); |
366 pending_request_ = NULL; | 365 pending_request_ = NULL; |
367 | 366 |
368 for (size_t n = 0; n < established_callbacks_.size(); n++) | 367 for (size_t n = 0; n < established_callbacks_.size(); n++) |
369 established_callbacks_[n].Run(); | 368 established_callbacks_[n].Run(); |
370 | 369 |
371 established_callbacks_.clear(); | 370 established_callbacks_.clear(); |
372 } | 371 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 filter->AddRoute(MSG_ROUTING_CONTROL, handler); | 420 filter->AddRoute(MSG_ROUTING_CONTROL, handler); |
422 | 421 |
423 GetIOLoopProxy()->PostTask( | 422 GetIOLoopProxy()->PostTask( |
424 FROM_HERE, | 423 FROM_HERE, |
425 base::Bind(&BrowserGpuChannelHostFactory::AddFilterOnIO, | 424 base::Bind(&BrowserGpuChannelHostFactory::AddFilterOnIO, |
426 gpu_host_id_, | 425 gpu_host_id_, |
427 filter)); | 426 filter)); |
428 } | 427 } |
429 | 428 |
430 } // namespace content | 429 } // namespace content |
OLD | NEW |