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

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

Issue 65193003: Clear SingleProcess and InProcessGPU logic. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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
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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 576
577 bool GpuProcessHost::Init() { 577 bool GpuProcessHost::Init() {
578 init_start_time_ = base::TimeTicks::Now(); 578 init_start_time_ = base::TimeTicks::Now();
579 579
580 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess", TRACE_EVENT_SCOPE_THREAD); 580 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess", TRACE_EVENT_SCOPE_THREAD);
581 581
582 std::string channel_id = process_->GetHost()->CreateChannel(); 582 std::string channel_id = process_->GetHost()->CreateChannel();
583 if (channel_id.empty()) 583 if (channel_id.empty())
584 return false; 584 return false;
585 585
586 if (in_process_ && g_gpu_main_thread_factory) { 586 if (in_process_) {
587 CHECK(g_gpu_main_thread_factory);
piman 2013/11/07 22:09:52 Should be DCHECK.
dshwang 2013/11/08 10:05:56 yes. but it will crash in next line. in_process_gp
587 CommandLine::ForCurrentProcess()->AppendSwitch( 588 CommandLine::ForCurrentProcess()->AppendSwitch(
588 switches::kDisableGpuWatchdog); 589 switches::kDisableGpuWatchdog);
589 590
590 in_process_gpu_thread_.reset(g_gpu_main_thread_factory(channel_id)); 591 in_process_gpu_thread_.reset(g_gpu_main_thread_factory(channel_id));
591 in_process_gpu_thread_->Start(); 592 in_process_gpu_thread_->Start();
592 593
593 OnProcessLaunched(); // Fake a callback that the process is ready. 594 OnProcessLaunched(); // Fake a callback that the process is ready.
594 } else if (!LaunchGpuProcess(channel_id)) { 595 } else if (!LaunchGpuProcess(channel_id)) {
595 return false; 596 return false;
596 } 597 }
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1256 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); 1257 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader");
1257 ClientIdToShaderCacheMap::iterator iter = 1258 ClientIdToShaderCacheMap::iterator iter =
1258 client_id_to_shader_cache_.find(client_id); 1259 client_id_to_shader_cache_.find(client_id);
1259 // If the cache doesn't exist then this is an off the record profile. 1260 // If the cache doesn't exist then this is an off the record profile.
1260 if (iter == client_id_to_shader_cache_.end()) 1261 if (iter == client_id_to_shader_cache_.end())
1261 return; 1262 return;
1262 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); 1263 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader);
1263 } 1264 }
1264 1265
1265 } // namespace content 1266 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698