Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Side by Side Diff: content/browser/gpu/gpu_process_host.cc

Issue 129633002: Also append GPU command-line flags to the browser in single-process mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix single-process cleanup Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 init_start_time_ = base::TimeTicks::Now(); 571 init_start_time_ = base::TimeTicks::Now();
572 572
573 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess", TRACE_EVENT_SCOPE_THREAD); 573 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess", TRACE_EVENT_SCOPE_THREAD);
574 574
575 std::string channel_id = process_->GetHost()->CreateChannel(); 575 std::string channel_id = process_->GetHost()->CreateChannel();
576 if (channel_id.empty()) 576 if (channel_id.empty())
577 return false; 577 return false;
578 578
579 if (in_process_) { 579 if (in_process_) {
580 DCHECK(g_gpu_main_thread_factory); 580 DCHECK(g_gpu_main_thread_factory);
581 CommandLine::ForCurrentProcess()->AppendSwitch( 581 CommandLine* command_line = CommandLine::ForCurrentProcess();
582 switches::kDisableGpuWatchdog); 582 command_line->AppendSwitch(switches::kDisableGpuWatchdog);
583
584 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
585 DCHECK(gpu_data_manager);
586 gpu_data_manager->AppendGpuCommandLine(command_line);
583 587
584 in_process_gpu_thread_.reset(g_gpu_main_thread_factory(channel_id)); 588 in_process_gpu_thread_.reset(g_gpu_main_thread_factory(channel_id));
585 in_process_gpu_thread_->Start(); 589 in_process_gpu_thread_->Start();
586 590
587 OnProcessLaunched(); // Fake a callback that the process is ready. 591 OnProcessLaunched(); // Fake a callback that the process is ready.
588 } else if (!LaunchGpuProcess(channel_id)) { 592 } else if (!LaunchGpuProcess(channel_id)) {
589 return false; 593 return false;
590 } 594 }
591 595
592 if (!Send(new GpuMsg_Initialize())) 596 if (!Send(new GpuMsg_Initialize()))
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); 1265 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader");
1262 ClientIdToShaderCacheMap::iterator iter = 1266 ClientIdToShaderCacheMap::iterator iter =
1263 client_id_to_shader_cache_.find(client_id); 1267 client_id_to_shader_cache_.find(client_id);
1264 // If the cache doesn't exist then this is an off the record profile. 1268 // If the cache doesn't exist then this is an off the record profile.
1265 if (iter == client_id_to_shader_cache_.end()) 1269 if (iter == client_id_to_shader_cache_.end())
1266 return; 1270 return;
1267 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); 1271 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader);
1268 } 1272 }
1269 1273
1270 } // namespace content 1274 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698