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

Side by Side 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: 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 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/public/app/content_main_runner.h" 5 #include "content/public/app/content_main_runner.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <string.h> 9 #include <string.h>
10 #include <string> 10 #include <string>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 62 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
63 #include "gin/v8_initializer.h" 63 #include "gin/v8_initializer.h"
64 #endif 64 #endif
65 65
66 #if !defined(OS_IOS) 66 #if !defined(OS_IOS)
67 #include "content/app/mojo/mojo_init.h" 67 #include "content/app/mojo/mojo_init.h"
68 #include "content/browser/gpu/gpu_process_host.h" 68 #include "content/browser/gpu/gpu_process_host.h"
69 #include "content/browser/renderer_host/render_process_host_impl.h" 69 #include "content/browser/renderer_host/render_process_host_impl.h"
70 #include "content/browser/utility_process_host_impl.h" 70 #include "content/browser/utility_process_host_impl.h"
71 #include "content/public/gpu/content_gpu_client.h"
71 #include "content/public/plugin/content_plugin_client.h" 72 #include "content/public/plugin/content_plugin_client.h"
72 #include "content/public/renderer/content_renderer_client.h" 73 #include "content/public/renderer/content_renderer_client.h"
73 #include "content/public/utility/content_utility_client.h" 74 #include "content/public/utility/content_utility_client.h"
74 #endif 75 #endif
75 76
76 #if defined(OS_WIN) 77 #if defined(OS_WIN)
77 #include <malloc.h> 78 #include <malloc.h>
78 #include <cstring> 79 #include <cstring>
79 80
80 #include "base/trace_event/trace_event_etw_export_win.h" 81 #include "base/trace_event/trace_event_etw_export_win.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } // namespace content 125 } // namespace content
125 126
126 namespace content { 127 namespace content {
127 128
128 #if !defined(CHROME_MULTIPLE_DLL_CHILD) 129 #if !defined(CHROME_MULTIPLE_DLL_CHILD)
129 base::LazyInstance<ContentBrowserClient> 130 base::LazyInstance<ContentBrowserClient>
130 g_empty_content_browser_client = LAZY_INSTANCE_INITIALIZER; 131 g_empty_content_browser_client = LAZY_INSTANCE_INITIALIZER;
131 #endif // !CHROME_MULTIPLE_DLL_CHILD 132 #endif // !CHROME_MULTIPLE_DLL_CHILD
132 133
133 #if !defined(OS_IOS) && !defined(CHROME_MULTIPLE_DLL_BROWSER) 134 #if !defined(OS_IOS) && !defined(CHROME_MULTIPLE_DLL_BROWSER)
135 base::LazyInstance<ContentGpuClient> g_empty_content_gpu_client =
jam 2016/01/28 16:47:36 nit: follow the rest of the lines and indent g_emp
kcwu 2016/01/29 17:22:44 Done.
136 LAZY_INSTANCE_INITIALIZER;
134 base::LazyInstance<ContentPluginClient> 137 base::LazyInstance<ContentPluginClient>
135 g_empty_content_plugin_client = LAZY_INSTANCE_INITIALIZER; 138 g_empty_content_plugin_client = LAZY_INSTANCE_INITIALIZER;
136 base::LazyInstance<ContentRendererClient> 139 base::LazyInstance<ContentRendererClient>
137 g_empty_content_renderer_client = LAZY_INSTANCE_INITIALIZER; 140 g_empty_content_renderer_client = LAZY_INSTANCE_INITIALIZER;
138 base::LazyInstance<ContentUtilityClient> 141 base::LazyInstance<ContentUtilityClient>
139 g_empty_content_utility_client = LAZY_INSTANCE_INITIALIZER; 142 g_empty_content_utility_client = LAZY_INSTANCE_INITIALIZER;
140 #endif // !OS_IOS && !CHROME_MULTIPLE_DLL_BROWSER 143 #endif // !OS_IOS && !CHROME_MULTIPLE_DLL_BROWSER
141 144
142 #if defined(OS_POSIX) && !defined(OS_IOS) 145 #if defined(OS_POSIX) && !defined(OS_IOS)
143 146
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 #if !defined(CHROME_MULTIPLE_DLL_CHILD) 208 #if !defined(CHROME_MULTIPLE_DLL_CHILD)
206 if (process_type.empty()) { 209 if (process_type.empty()) {
207 if (delegate) 210 if (delegate)
208 content_client->browser_ = delegate->CreateContentBrowserClient(); 211 content_client->browser_ = delegate->CreateContentBrowserClient();
209 if (!content_client->browser_) 212 if (!content_client->browser_)
210 content_client->browser_ = &g_empty_content_browser_client.Get(); 213 content_client->browser_ = &g_empty_content_browser_client.Get();
211 } 214 }
212 #endif // !CHROME_MULTIPLE_DLL_CHILD 215 #endif // !CHROME_MULTIPLE_DLL_CHILD
213 216
214 #if !defined(OS_IOS) && !defined(CHROME_MULTIPLE_DLL_BROWSER) 217 #if !defined(OS_IOS) && !defined(CHROME_MULTIPLE_DLL_BROWSER)
218 if (process_type == switches::kGpuProcess ||
219 base::CommandLine::ForCurrentProcess()->HasSwitch(
220 switches::kSingleProcess)) {
221 if (delegate)
222 content_client->gpu_ = delegate->CreateContentGpuClient();
223 if (!content_client->gpu_)
224 content_client->gpu_ = &g_empty_content_gpu_client.Get();
225 }
226
215 if (process_type == switches::kPluginProcess || 227 if (process_type == switches::kPluginProcess ||
216 process_type == switches::kPpapiPluginProcess) { 228 process_type == switches::kPpapiPluginProcess) {
217 if (delegate) 229 if (delegate)
218 content_client->plugin_ = delegate->CreateContentPluginClient(); 230 content_client->plugin_ = delegate->CreateContentPluginClient();
219 if (!content_client->plugin_) 231 if (!content_client->plugin_)
220 content_client->plugin_ = &g_empty_content_plugin_client.Get(); 232 content_client->plugin_ = &g_empty_content_plugin_client.Get();
221 // Single process not supported in split dll mode. 233 // Single process not supported in split dll mode.
222 } else if (process_type == switches::kRendererProcess || 234 } else if (process_type == switches::kRendererProcess ||
223 base::CommandLine::ForCurrentProcess()->HasSwitch( 235 base::CommandLine::ForCurrentProcess()->HasSwitch(
224 switches::kSingleProcess)) { 236 switches::kSingleProcess)) {
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 807
796 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); 808 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl);
797 }; 809 };
798 810
799 // static 811 // static
800 ContentMainRunner* ContentMainRunner::Create() { 812 ContentMainRunner* ContentMainRunner::Create() {
801 return new ContentMainRunnerImpl(); 813 return new ContentMainRunnerImpl();
802 } 814 }
803 815
804 } // namespace content 816 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698