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 "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/i18n/icu_util.h" | 12 #include "base/i18n/icu_util.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/metrics/stats_table.h" | 15 #include "base/metrics/stats_table.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "base/process_util.h" | 17 #include "base/process_util.h" |
18 #include "base/stringprintf.h" | 18 #include "base/stringprintf.h" |
19 #include "base/string_number_conversions.h" | 19 #include "base/string_number_conversions.h" |
20 #include "content/browser/browser_main.h" | 20 #include "content/browser/browser_main.h" |
21 #include "content/common/set_process_title.h" | 21 #include "content/common/set_process_title.h" |
22 #include "content/public/app/content_main_delegate.h" | 22 #include "content/public/app/content_main_delegate.h" |
23 #include "content/public/app/startup_helper_win.h" | 23 #include "content/public/app/startup_helper_win.h" |
24 #include "content/public/common/content_client.h" | 24 #include "content/public/common/content_client.h" |
25 #include "content/public/common/content_constants.h" | 25 #include "content/public/common/content_constants.h" |
26 #include "content/public/common/content_paths.h" | 26 #include "content/public/common/content_paths.h" |
27 #include "content/public/common/content_switches.h" | 27 #include "content/public/common/content_switches.h" |
28 #include "content/public/common/main_function_params.h" | 28 #include "content/public/common/main_function_params.h" |
29 #include "content/public/common/sandbox_init.h" | 29 #include "content/public/common/sandbox_init.h" |
30 #include "content/public/common/url_constants.h" | |
30 #include "crypto/nss_util.h" | 31 #include "crypto/nss_util.h" |
31 #include "ipc/ipc_switches.h" | 32 #include "ipc/ipc_switches.h" |
32 #include "media/base/media.h" | 33 #include "media/base/media.h" |
33 #include "sandbox/src/sandbox_types.h" | 34 #include "sandbox/src/sandbox_types.h" |
34 #include "ui/base/ui_base_switches.h" | 35 #include "ui/base/ui_base_switches.h" |
35 #include "ui/base/ui_base_paths.h" | 36 #include "ui/base/ui_base_paths.h" |
36 #include "webkit/glue/webkit_glue.h" | 37 #include "webkit/glue/webkit_glue.h" |
37 | 38 |
38 #if defined(OS_WIN) | 39 #if defined(OS_WIN) |
39 #include <atlbase.h> | 40 #include <atlbase.h> |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
459 #elif defined(OS_POSIX) | 460 #elif defined(OS_POSIX) |
460 // On linux, we're in the zygote here; so we need the parent process' id. | 461 // On linux, we're in the zygote here; so we need the parent process' id. |
461 browser_pid = base::GetParentProcessId(base::GetCurrentProcId()); | 462 browser_pid = base::GetParentProcessId(base::GetCurrentProcId()); |
462 #endif | 463 #endif |
463 } | 464 } |
464 | 465 |
465 InitializeStatsTable(browser_pid, command_line); | 466 InitializeStatsTable(browser_pid, command_line); |
466 | 467 |
467 if (delegate) | 468 if (delegate) |
468 delegate->PreSandboxStartup(); | 469 delegate->PreSandboxStartup(); |
470 else | |
jam
2012/04/02 16:19:25
you're assuming that the presence of a delegate me
michaeln
2012/04/02 19:37:22
Sure, is this what you intend...
* add an uncondi
jam
2012/04/02 20:23:13
yep
| |
471 content::RegisterContentSchemes(NULL); | |
469 | 472 |
470 if (!process_type.empty()) | 473 if (!process_type.empty()) |
471 CommonSubprocessInit(process_type); | 474 CommonSubprocessInit(process_type); |
472 | 475 |
473 #if defined(OS_WIN) | 476 #if defined(OS_WIN) |
474 CHECK(content::InitializeSandbox(sandbox_info)); | 477 CHECK(content::InitializeSandbox(sandbox_info)); |
475 #elif defined(OS_MACOSX) | 478 #elif defined(OS_MACOSX) |
476 if (process_type == switches::kRendererProcess || | 479 if (process_type == switches::kRendererProcess || |
477 process_type == switches::kPpapiPluginProcess || | 480 process_type == switches::kPpapiPluginProcess || |
478 (delegate && delegate->DelaySandboxInitialization(process_type))) { | 481 (delegate && delegate->DelaySandboxInitialization(process_type))) { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
567 } // namespace | 570 } // namespace |
568 | 571 |
569 namespace content { | 572 namespace content { |
570 | 573 |
571 // static | 574 // static |
572 ContentMainRunner* ContentMainRunner::Create() { | 575 ContentMainRunner* ContentMainRunner::Create() { |
573 return new ContentMainRunnerImpl(); | 576 return new ContentMainRunnerImpl(); |
574 } | 577 } |
575 | 578 |
576 } // namespace content | 579 } // namespace content |
OLD | NEW |