Chromium Code Reviews| 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 <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include "base/allocator/allocator_extension.h" | 9 #include "base/allocator/allocator_extension.h" |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 | 88 |
| 89 #if !defined(OS_MACOSX) | 89 #if !defined(OS_MACOSX) |
| 90 #include "content/public/common/zygote_fork_delegate_linux.h" | 90 #include "content/public/common/zygote_fork_delegate_linux.h" |
| 91 #endif | 91 #endif |
| 92 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 92 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 93 #include "content/zygote/zygote_main.h" | 93 #include "content/zygote/zygote_main.h" |
| 94 #endif | 94 #endif |
| 95 | 95 |
| 96 #endif // OS_POSIX | 96 #endif // OS_POSIX |
| 97 | 97 |
| 98 #if defined(USE_OZONE) | |
| 99 #include "ui/ozone/ozone_platform.h" | |
| 100 #endif | |
| 101 | |
| 98 #if !defined(OS_MACOSX) && defined(USE_TCMALLOC) | 102 #if !defined(OS_MACOSX) && defined(USE_TCMALLOC) |
| 99 extern "C" { | 103 extern "C" { |
| 100 int tc_set_new_mode(int mode); | 104 int tc_set_new_mode(int mode); |
| 101 } | 105 } |
| 102 #endif | 106 #endif |
| 103 | 107 |
| 104 namespace content { | 108 namespace content { |
| 105 extern int GpuMain(const content::MainFunctionParams&); | 109 extern int GpuMain(const content::MainFunctionParams&); |
| 106 #if defined(ENABLE_PLUGINS) | 110 #if defined(ENABLE_PLUGINS) |
| 107 extern int PluginMain(const content::MainFunctionParams&); | 111 extern int PluginMain(const content::MainFunctionParams&); |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 713 #endif | 717 #endif |
| 714 | 718 |
| 715 ui::RegisterPathProvider(); | 719 ui::RegisterPathProvider(); |
| 716 RegisterPathProvider(); | 720 RegisterPathProvider(); |
| 717 RegisterContentSchemes(true); | 721 RegisterContentSchemes(true); |
| 718 | 722 |
| 719 CHECK(base::i18n::InitializeICU()); | 723 CHECK(base::i18n::InitializeICU()); |
| 720 | 724 |
| 721 InitializeStatsTable(command_line); | 725 InitializeStatsTable(command_line); |
| 722 | 726 |
| 727 #if defined(USE_OZONE) | |
| 728 ozone_platform_.reset(ui::OzonePlatform::Create()); | |
| 729 #endif | |
| 730 | |
|
vignatti (out of this project)
2013/10/28 15:26:44
have you thought whether a single line like this w
spang
2013/10/28 15:42:30
I do think we should be able to find a place to ow
| |
| 723 if (delegate) | 731 if (delegate) |
| 724 delegate->PreSandboxStartup(); | 732 delegate->PreSandboxStartup(); |
| 725 | 733 |
| 726 // Set any custom user agent passed on the command line now so the string | 734 // Set any custom user agent passed on the command line now so the string |
| 727 // doesn't change between calls to webkit_glue::GetUserAgent(), otherwise it | 735 // doesn't change between calls to webkit_glue::GetUserAgent(), otherwise it |
| 728 // defaults to the user agent set during SetContentClient(). | 736 // defaults to the user agent set during SetContentClient(). |
| 729 if (command_line.HasSwitch(switches::kUserAgent)) { | 737 if (command_line.HasSwitch(switches::kUserAgent)) { |
| 730 webkit_glue::SetUserAgent( | 738 webkit_glue::SetUserAgent( |
| 731 command_line.GetSwitchValueASCII(switches::kUserAgent), true); | 739 command_line.GetSwitchValueASCII(switches::kUserAgent), true); |
| 732 } | 740 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 824 | 832 |
| 825 // The delegate will outlive this object. | 833 // The delegate will outlive this object. |
| 826 ContentMainDelegate* delegate_; | 834 ContentMainDelegate* delegate_; |
| 827 | 835 |
| 828 scoped_ptr<base::AtExitManager> exit_manager_; | 836 scoped_ptr<base::AtExitManager> exit_manager_; |
| 829 #if defined(OS_WIN) | 837 #if defined(OS_WIN) |
| 830 sandbox::SandboxInterfaceInfo sandbox_info_; | 838 sandbox::SandboxInterfaceInfo sandbox_info_; |
| 831 #elif defined(OS_MACOSX) | 839 #elif defined(OS_MACOSX) |
| 832 scoped_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool_; | 840 scoped_ptr<base::mac::ScopedNSAutoreleasePool> autorelease_pool_; |
| 833 #endif | 841 #endif |
| 842 #if defined(USE_OZONE) | |
| 843 scoped_ptr<ui::OzonePlatform> ozone_platform_; | |
| 844 #endif | |
| 834 | 845 |
| 835 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 846 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
| 836 }; | 847 }; |
| 837 | 848 |
| 838 // static | 849 // static |
| 839 ContentMainRunner* ContentMainRunner::Create() { | 850 ContentMainRunner* ContentMainRunner::Create() { |
| 840 return new ContentMainRunnerImpl(); | 851 return new ContentMainRunnerImpl(); |
| 841 } | 852 } |
| 842 | 853 |
| 843 } // namespace content | 854 } // namespace content |
| OLD | NEW |