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

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

Issue 2163883005: WIP: Obtain Bootstrap from utility process Service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 15 matching lines...) Expand all
26 #include "base/trace_event/trace_event.h" 26 #include "base/trace_event/trace_event.h"
27 #include "build/build_config.h" 27 #include "build/build_config.h"
28 #include "components/tracing/common/tracing_switches.h" 28 #include "components/tracing/common/tracing_switches.h"
29 #include "content/browser/browser_child_process_host_impl.h" 29 #include "content/browser/browser_child_process_host_impl.h"
30 #include "content/browser/gpu/compositor_util.h" 30 #include "content/browser/gpu/compositor_util.h"
31 #include "content/browser/gpu/gpu_data_manager_impl.h" 31 #include "content/browser/gpu/gpu_data_manager_impl.h"
32 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 32 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
33 #include "content/browser/gpu/shader_disk_cache.h" 33 #include "content/browser/gpu/shader_disk_cache.h"
34 #include "content/browser/mojo/constants.h" 34 #include "content/browser/mojo/constants.h"
35 #include "content/browser/mojo/mojo_child_connection.h" 35 #include "content/browser/mojo/mojo_child_connection.h"
36 #include "content/browser/mojo/mojo_shell_context.h" 36 #include "content/browser/mojo/service_manager_context_impl.h"
37 #include "content/browser/renderer_host/render_widget_host_impl.h" 37 #include "content/browser/renderer_host/render_widget_host_impl.h"
38 #include "content/common/child_process_host_impl.h" 38 #include "content/common/child_process_host_impl.h"
39 #include "content/common/establish_channel_params.h" 39 #include "content/common/establish_channel_params.h"
40 #include "content/common/gpu_host_messages.h" 40 #include "content/common/gpu_host_messages.h"
41 #include "content/common/in_process_child_thread_params.h" 41 #include "content/common/in_process_child_thread_params.h"
42 #include "content/common/view_messages.h" 42 #include "content/common/view_messages.h"
43 #include "content/public/browser/browser_thread.h" 43 #include "content/public/browser/browser_thread.h"
44 #include "content/public/browser/content_browser_client.h" 44 #include "content/public/browser/content_browser_client.h"
45 #include "content/public/browser/gpu_utils.h" 45 #include "content/public/browser/gpu_utils.h"
46 #include "content/public/browser/render_process_host.h" 46 #include "content/public/browser/render_process_host.h"
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess", TRACE_EVENT_SCOPE_THREAD); 560 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess", TRACE_EVENT_SCOPE_THREAD);
561 561
562 const std::string mojo_channel_token = 562 const std::string mojo_channel_token =
563 process_->GetHost()->CreateChannelMojo(child_token_); 563 process_->GetHost()->CreateChannelMojo(child_token_);
564 if (mojo_channel_token.empty()) 564 if (mojo_channel_token.empty())
565 return false; 565 return false;
566 566
567 DCHECK(!mojo_child_connection_); 567 DCHECK(!mojo_child_connection_);
568 mojo_child_connection_.reset(new MojoChildConnection( 568 mojo_child_connection_.reset(new MojoChildConnection(
569 kGpuMojoApplicationName, "", child_token_, 569 kGpuMojoApplicationName, "", child_token_,
570 MojoShellContext::GetConnectorForIOThread(), 570 ServiceManagerContextImpl::GetConnectorForIOThread(),
571 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO))); 571 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)));
572 572
573 gpu::GpuPreferences gpu_preferences = GetGpuPreferencesFromCommandLine(); 573 gpu::GpuPreferences gpu_preferences = GetGpuPreferencesFromCommandLine();
574 if (in_process_) { 574 if (in_process_) {
575 DCHECK_CURRENTLY_ON(BrowserThread::IO); 575 DCHECK_CURRENTLY_ON(BrowserThread::IO);
576 DCHECK(g_gpu_main_thread_factory); 576 DCHECK(g_gpu_main_thread_factory);
577 in_process_gpu_thread_.reset(g_gpu_main_thread_factory( 577 in_process_gpu_thread_.reset(g_gpu_main_thread_factory(
578 InProcessChildThreadParams( 578 InProcessChildThreadParams(
579 std::string(), base::ThreadTaskRunnerHandle::Get(), 579 std::string(), base::ThreadTaskRunnerHandle::Get(),
580 mojo_channel_token, mojo_child_connection_->service_token()), 580 mojo_channel_token, mojo_child_connection_->service_token()),
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); 1188 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader");
1189 ClientIdToShaderCacheMap::iterator iter = 1189 ClientIdToShaderCacheMap::iterator iter =
1190 client_id_to_shader_cache_.find(client_id); 1190 client_id_to_shader_cache_.find(client_id);
1191 // If the cache doesn't exist then this is an off the record profile. 1191 // If the cache doesn't exist then this is an off the record profile.
1192 if (iter == client_id_to_shader_cache_.end()) 1192 if (iter == client_id_to_shader_cache_.end())
1193 return; 1193 return;
1194 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); 1194 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader);
1195 } 1195 }
1196 1196
1197 } // namespace content 1197 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_mojo_shell.cc ('k') | content/browser/mojo/mojo_shell_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698