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/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 BlockLiveOffscreenContexts(); | 467 BlockLiveOffscreenContexts(); |
468 | 468 |
469 BrowserThread::PostTask(BrowserThread::UI, | 469 BrowserThread::PostTask(BrowserThread::UI, |
470 FROM_HERE, | 470 FROM_HERE, |
471 base::Bind(&GpuProcessHostUIShim::Destroy, host_id_)); | 471 base::Bind(&GpuProcessHostUIShim::Destroy, host_id_)); |
472 } | 472 } |
473 | 473 |
474 bool GpuProcessHost::Init() { | 474 bool GpuProcessHost::Init() { |
475 init_start_time_ = base::TimeTicks::Now(); | 475 init_start_time_ = base::TimeTicks::Now(); |
476 | 476 |
477 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess"); | 477 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess", TRACE_EVENT_SCOPE_THREAD); |
478 | 478 |
479 std::string channel_id = process_->GetHost()->CreateChannel(); | 479 std::string channel_id = process_->GetHost()->CreateChannel(); |
480 if (channel_id.empty()) | 480 if (channel_id.empty()) |
481 return false; | 481 return false; |
482 | 482 |
483 if (in_process_) { | 483 if (in_process_) { |
484 CommandLine::ForCurrentProcess()->AppendSwitch( | 484 CommandLine::ForCurrentProcess()->AppendSwitch( |
485 switches::kDisableGpuWatchdog); | 485 switches::kDisableGpuWatchdog); |
486 | 486 |
487 in_process_gpu_thread_.reset(new GpuMainThread(channel_id)); | 487 in_process_gpu_thread_.reset(new GpuMainThread(channel_id)); |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 void GpuProcessHost::BlockLiveOffscreenContexts() { | 1058 void GpuProcessHost::BlockLiveOffscreenContexts() { |
1059 for (std::multiset<GURL>::iterator iter = | 1059 for (std::multiset<GURL>::iterator iter = |
1060 urls_with_live_offscreen_contexts_.begin(); | 1060 urls_with_live_offscreen_contexts_.begin(); |
1061 iter != urls_with_live_offscreen_contexts_.end(); ++iter) { | 1061 iter != urls_with_live_offscreen_contexts_.end(); ++iter) { |
1062 GpuDataManagerImpl::GetInstance()->BlockDomainFrom3DAPIs( | 1062 GpuDataManagerImpl::GetInstance()->BlockDomainFrom3DAPIs( |
1063 *iter, GpuDataManagerImpl::DOMAIN_GUILT_UNKNOWN); | 1063 *iter, GpuDataManagerImpl::DOMAIN_GUILT_UNKNOWN); |
1064 } | 1064 } |
1065 } | 1065 } |
1066 | 1066 |
1067 } // namespace content | 1067 } // namespace content |
OLD | NEW |