| 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/location.h" | 8 #include "base/location.h" |
| 9 #include "base/profiler/scoped_tracker.h" | 9 #include "base/profiler/scoped_tracker.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 DCHECK(instance_); | 229 DCHECK(instance_); |
| 230 delete instance_; | 230 delete instance_; |
| 231 instance_ = NULL; | 231 instance_ = NULL; |
| 232 } | 232 } |
| 233 | 233 |
| 234 BrowserGpuChannelHostFactory::BrowserGpuChannelHostFactory() | 234 BrowserGpuChannelHostFactory::BrowserGpuChannelHostFactory() |
| 235 : gpu_client_id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()), | 235 : gpu_client_id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()), |
| 236 gpu_client_tracing_id_(ChildProcessHost::kBrowserTracingProcessId), | 236 gpu_client_tracing_id_(ChildProcessHost::kBrowserTracingProcessId), |
| 237 shutdown_event_(new base::WaitableEvent(true, false)), | 237 shutdown_event_(new base::WaitableEvent(true, false)), |
| 238 gpu_memory_buffer_manager_( | 238 gpu_memory_buffer_manager_( |
| 239 new BrowserGpuMemoryBufferManager(gpu_client_id_)), | 239 new BrowserGpuMemoryBufferManager(gpu_client_id_, |
| 240 gpu_client_tracing_id_)), |
| 240 gpu_host_id_(0) {} | 241 gpu_host_id_(0) {} |
| 241 | 242 |
| 242 BrowserGpuChannelHostFactory::~BrowserGpuChannelHostFactory() { | 243 BrowserGpuChannelHostFactory::~BrowserGpuChannelHostFactory() { |
| 243 DCHECK(IsMainThread()); | 244 DCHECK(IsMainThread()); |
| 244 if (pending_request_.get()) | 245 if (pending_request_.get()) |
| 245 pending_request_->Cancel(); | 246 pending_request_->Cancel(); |
| 246 for (size_t n = 0; n < established_callbacks_.size(); n++) | 247 for (size_t n = 0; n < established_callbacks_.size(); n++) |
| 247 established_callbacks_[n].Run(); | 248 established_callbacks_[n].Run(); |
| 248 shutdown_event_->Signal(); | 249 shutdown_event_->Signal(); |
| 249 if (gpu_channel_) { | 250 if (gpu_channel_) { |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 int host_id, | 413 int host_id, |
| 413 scoped_refptr<IPC::MessageFilter> filter) { | 414 scoped_refptr<IPC::MessageFilter> filter) { |
| 414 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 415 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 415 | 416 |
| 416 GpuProcessHost* host = GpuProcessHost::FromID(host_id); | 417 GpuProcessHost* host = GpuProcessHost::FromID(host_id); |
| 417 if (host) | 418 if (host) |
| 418 host->AddFilter(filter.get()); | 419 host->AddFilter(filter.get()); |
| 419 } | 420 } |
| 420 | 421 |
| 421 } // namespace content | 422 } // namespace content |
| OLD | NEW |