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/base64.h" | 7 #include "base/base64.h" |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 BrowserThread::PostTask(BrowserThread::UI, | 625 BrowserThread::PostTask(BrowserThread::UI, |
626 FROM_HERE, | 626 FROM_HERE, |
627 base::Bind(&GpuProcessHostUIShim::Destroy, | 627 base::Bind(&GpuProcessHostUIShim::Destroy, |
628 host_id_, | 628 host_id_, |
629 message)); | 629 message)); |
630 } | 630 } |
631 | 631 |
632 bool GpuProcessHost::Init() { | 632 bool GpuProcessHost::Init() { |
633 init_start_time_ = base::TimeTicks::Now(); | 633 init_start_time_ = base::TimeTicks::Now(); |
634 | 634 |
635 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess"); | 635 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess", TRACE_EVENT_SCOPE_THREAD); |
636 | 636 |
637 std::string channel_id = process_->GetHost()->CreateChannel(); | 637 std::string channel_id = process_->GetHost()->CreateChannel(); |
638 if (channel_id.empty()) | 638 if (channel_id.empty()) |
639 return false; | 639 return false; |
640 | 640 |
641 if (in_process_) { | 641 if (in_process_) { |
642 CommandLine::ForCurrentProcess()->AppendSwitch( | 642 CommandLine::ForCurrentProcess()->AppendSwitch( |
643 switches::kDisableGpuWatchdog); | 643 switches::kDisableGpuWatchdog); |
644 | 644 |
645 in_process_gpu_thread_.reset(new GpuMainThread(channel_id)); | 645 in_process_gpu_thread_.reset(new GpuMainThread(channel_id)); |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1298 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1298 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1299 ClientIdToShaderCacheMap::iterator iter = | 1299 ClientIdToShaderCacheMap::iterator iter = |
1300 client_id_to_shader_cache_.find(client_id); | 1300 client_id_to_shader_cache_.find(client_id); |
1301 // If the cache doesn't exist then this is an off the record profile. | 1301 // If the cache doesn't exist then this is an off the record profile. |
1302 if (iter == client_id_to_shader_cache_.end()) | 1302 if (iter == client_id_to_shader_cache_.end()) |
1303 return; | 1303 return; |
1304 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1304 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1305 } | 1305 } |
1306 | 1306 |
1307 } // namespace content | 1307 } // namespace content |
OLD | NEW |