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

Unified Diff: content/app/content_main_runner.cc

Issue 1646853002: Add embedder api for participating in gpu logic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix crash in tests Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/BUILD.gn ('k') | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/content_main_runner.cc
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 59efad39c71c1db2ae542522e332e8e6cf293b2e..ba10cbb430c1d557b2521473079b6ead49cb6fd1 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -68,6 +68,7 @@
#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/utility_process_host_impl.h"
+#include "content/public/gpu/content_gpu_client.h"
#include "content/public/plugin/content_plugin_client.h"
#include "content/public/renderer/content_renderer_client.h"
#include "content/public/utility/content_utility_client.h"
@@ -134,6 +135,8 @@ base::LazyInstance<ContentBrowserClient>
#endif // !CHROME_MULTIPLE_DLL_CHILD
#if !defined(OS_IOS) && !defined(CHROME_MULTIPLE_DLL_BROWSER)
+base::LazyInstance<ContentGpuClient>
+ g_empty_content_gpu_client = LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<ContentPluginClient>
g_empty_content_plugin_client = LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<ContentRendererClient>
@@ -225,6 +228,15 @@ class ContentClientInitializer {
#endif // !CHROME_MULTIPLE_DLL_CHILD
#if !defined(OS_IOS) && !defined(CHROME_MULTIPLE_DLL_BROWSER)
+ if (process_type == switches::kGpuProcess ||
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSingleProcess)) {
+ if (delegate)
+ content_client->gpu_ = delegate->CreateContentGpuClient();
+ if (!content_client->gpu_)
+ content_client->gpu_ = &g_empty_content_gpu_client.Get();
+ }
+
if (process_type == switches::kPluginProcess ||
process_type == switches::kPpapiPluginProcess) {
if (delegate)
« no previous file with comments | « content/BUILD.gn ('k') | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698