| 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 | 10 |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 #if !defined(CHROME_MULTIPLE_DLL_CHILD) | 255 #if !defined(CHROME_MULTIPLE_DLL_CHILD) |
| 256 if (process_type.empty()) { | 256 if (process_type.empty()) { |
| 257 if (delegate) | 257 if (delegate) |
| 258 content_client->browser_ = delegate->CreateContentBrowserClient(); | 258 content_client->browser_ = delegate->CreateContentBrowserClient(); |
| 259 if (!content_client->browser_) | 259 if (!content_client->browser_) |
| 260 content_client->browser_ = &g_empty_content_browser_client.Get(); | 260 content_client->browser_ = &g_empty_content_browser_client.Get(); |
| 261 } | 261 } |
| 262 #endif // !CHROME_MULTIPLE_DLL_CHILD | 262 #endif // !CHROME_MULTIPLE_DLL_CHILD |
| 263 | 263 |
| 264 #if !defined(CHROME_MULTIPLE_DLL_BROWSER) | 264 #if !defined(CHROME_MULTIPLE_DLL_BROWSER) |
| 265 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
| 265 if (process_type == switches::kGpuProcess || | 266 if (process_type == switches::kGpuProcess || |
| 266 base::CommandLine::ForCurrentProcess()->HasSwitch( | 267 cmd->HasSwitch(switches::kSingleProcess) || |
| 267 switches::kSingleProcess)) { | 268 (process_type.empty() && cmd->HasSwitch(switches::kInProcessGPU))) { |
| 268 if (delegate) | 269 if (delegate) |
| 269 content_client->gpu_ = delegate->CreateContentGpuClient(); | 270 content_client->gpu_ = delegate->CreateContentGpuClient(); |
| 270 if (!content_client->gpu_) | 271 if (!content_client->gpu_) |
| 271 content_client->gpu_ = &g_empty_content_gpu_client.Get(); | 272 content_client->gpu_ = &g_empty_content_gpu_client.Get(); |
| 272 } | 273 } |
| 273 | 274 |
| 274 if (process_type == switches::kRendererProcess || | 275 if (process_type == switches::kRendererProcess || |
| 275 base::CommandLine::ForCurrentProcess()->HasSwitch( | 276 cmd->HasSwitch(switches::kSingleProcess)) { |
| 276 switches::kSingleProcess)) { | |
| 277 if (delegate) | 277 if (delegate) |
| 278 content_client->renderer_ = delegate->CreateContentRendererClient(); | 278 content_client->renderer_ = delegate->CreateContentRendererClient(); |
| 279 if (!content_client->renderer_) | 279 if (!content_client->renderer_) |
| 280 content_client->renderer_ = &g_empty_content_renderer_client.Get(); | 280 content_client->renderer_ = &g_empty_content_renderer_client.Get(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 if (process_type == switches::kUtilityProcess || | 283 if (process_type == switches::kUtilityProcess || |
| 284 base::CommandLine::ForCurrentProcess()->HasSwitch( | 284 cmd->HasSwitch(switches::kSingleProcess)) { |
| 285 switches::kSingleProcess)) { | |
| 286 if (delegate) | 285 if (delegate) |
| 287 content_client->utility_ = delegate->CreateContentUtilityClient(); | 286 content_client->utility_ = delegate->CreateContentUtilityClient(); |
| 288 // TODO(scottmg): http://crbug.com/237249 Should be in _child. | 287 // TODO(scottmg): http://crbug.com/237249 Should be in _child. |
| 289 if (!content_client->utility_) | 288 if (!content_client->utility_) |
| 290 content_client->utility_ = &g_empty_content_utility_client.Get(); | 289 content_client->utility_ = &g_empty_content_utility_client.Get(); |
| 291 } | 290 } |
| 292 #endif // !CHROME_MULTIPLE_DLL_BROWSER | 291 #endif // !CHROME_MULTIPLE_DLL_BROWSER |
| 293 } | 292 } |
| 294 }; | 293 }; |
| 295 | 294 |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 | 843 |
| 845 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 844 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
| 846 }; | 845 }; |
| 847 | 846 |
| 848 // static | 847 // static |
| 849 ContentMainRunner* ContentMainRunner::Create() { | 848 ContentMainRunner* ContentMainRunner::Create() { |
| 850 return new ContentMainRunnerImpl(); | 849 return new ContentMainRunnerImpl(); |
| 851 } | 850 } |
| 852 | 851 |
| 853 } // namespace content | 852 } // namespace content |
| OLD | NEW |