| OLD | NEW |
| 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 Loading... |
| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 } // namespace content | 128 } // namespace content |
| 128 | 129 |
| 129 namespace content { | 130 namespace content { |
| 130 | 131 |
| 131 #if !defined(CHROME_MULTIPLE_DLL_CHILD) | 132 #if !defined(CHROME_MULTIPLE_DLL_CHILD) |
| 132 base::LazyInstance<ContentBrowserClient> | 133 base::LazyInstance<ContentBrowserClient> |
| 133 g_empty_content_browser_client = LAZY_INSTANCE_INITIALIZER; | 134 g_empty_content_browser_client = LAZY_INSTANCE_INITIALIZER; |
| 134 #endif // !CHROME_MULTIPLE_DLL_CHILD | 135 #endif // !CHROME_MULTIPLE_DLL_CHILD |
| 135 | 136 |
| 136 #if !defined(OS_IOS) && !defined(CHROME_MULTIPLE_DLL_BROWSER) | 137 #if !defined(OS_IOS) && !defined(CHROME_MULTIPLE_DLL_BROWSER) |
| 138 base::LazyInstance<ContentGpuClient> |
| 139 g_empty_content_gpu_client = LAZY_INSTANCE_INITIALIZER; |
| 137 base::LazyInstance<ContentPluginClient> | 140 base::LazyInstance<ContentPluginClient> |
| 138 g_empty_content_plugin_client = LAZY_INSTANCE_INITIALIZER; | 141 g_empty_content_plugin_client = LAZY_INSTANCE_INITIALIZER; |
| 139 base::LazyInstance<ContentRendererClient> | 142 base::LazyInstance<ContentRendererClient> |
| 140 g_empty_content_renderer_client = LAZY_INSTANCE_INITIALIZER; | 143 g_empty_content_renderer_client = LAZY_INSTANCE_INITIALIZER; |
| 141 base::LazyInstance<ContentUtilityClient> | 144 base::LazyInstance<ContentUtilityClient> |
| 142 g_empty_content_utility_client = LAZY_INSTANCE_INITIALIZER; | 145 g_empty_content_utility_client = LAZY_INSTANCE_INITIALIZER; |
| 143 #endif // !OS_IOS && !CHROME_MULTIPLE_DLL_BROWSER | 146 #endif // !OS_IOS && !CHROME_MULTIPLE_DLL_BROWSER |
| 144 | 147 |
| 145 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) && defined(OS_ANDROID) | 148 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) && defined(OS_ANDROID) |
| 146 #if defined __LP64__ | 149 #if defined __LP64__ |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 #if !defined(CHROME_MULTIPLE_DLL_CHILD) | 221 #if !defined(CHROME_MULTIPLE_DLL_CHILD) |
| 219 if (process_type.empty()) { | 222 if (process_type.empty()) { |
| 220 if (delegate) | 223 if (delegate) |
| 221 content_client->browser_ = delegate->CreateContentBrowserClient(); | 224 content_client->browser_ = delegate->CreateContentBrowserClient(); |
| 222 if (!content_client->browser_) | 225 if (!content_client->browser_) |
| 223 content_client->browser_ = &g_empty_content_browser_client.Get(); | 226 content_client->browser_ = &g_empty_content_browser_client.Get(); |
| 224 } | 227 } |
| 225 #endif // !CHROME_MULTIPLE_DLL_CHILD | 228 #endif // !CHROME_MULTIPLE_DLL_CHILD |
| 226 | 229 |
| 227 #if !defined(OS_IOS) && !defined(CHROME_MULTIPLE_DLL_BROWSER) | 230 #if !defined(OS_IOS) && !defined(CHROME_MULTIPLE_DLL_BROWSER) |
| 231 if (process_type == switches::kGpuProcess || |
| 232 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 233 switches::kSingleProcess)) { |
| 234 if (delegate) |
| 235 content_client->gpu_ = delegate->CreateContentGpuClient(); |
| 236 if (!content_client->gpu_) |
| 237 content_client->gpu_ = &g_empty_content_gpu_client.Get(); |
| 238 } |
| 239 |
| 228 if (process_type == switches::kPluginProcess || | 240 if (process_type == switches::kPluginProcess || |
| 229 process_type == switches::kPpapiPluginProcess) { | 241 process_type == switches::kPpapiPluginProcess) { |
| 230 if (delegate) | 242 if (delegate) |
| 231 content_client->plugin_ = delegate->CreateContentPluginClient(); | 243 content_client->plugin_ = delegate->CreateContentPluginClient(); |
| 232 if (!content_client->plugin_) | 244 if (!content_client->plugin_) |
| 233 content_client->plugin_ = &g_empty_content_plugin_client.Get(); | 245 content_client->plugin_ = &g_empty_content_plugin_client.Get(); |
| 234 // Single process not supported in split dll mode. | 246 // Single process not supported in split dll mode. |
| 235 } else if (process_type == switches::kRendererProcess || | 247 } else if (process_type == switches::kRendererProcess || |
| 236 base::CommandLine::ForCurrentProcess()->HasSwitch( | 248 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 237 switches::kSingleProcess)) { | 249 switches::kSingleProcess)) { |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 | 823 |
| 812 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 824 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
| 813 }; | 825 }; |
| 814 | 826 |
| 815 // static | 827 // static |
| 816 ContentMainRunner* ContentMainRunner::Create() { | 828 ContentMainRunner* ContentMainRunner::Create() { |
| 817 return new ContentMainRunnerImpl(); | 829 return new ContentMainRunnerImpl(); |
| 818 } | 830 } |
| 819 | 831 |
| 820 } // namespace content | 832 } // namespace content |
| OLD | NEW |