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 <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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 | 99 |
| 100 #if !defined(OS_MACOSX) | 100 #if !defined(OS_MACOSX) |
| 101 #include "content/public/common/zygote_fork_delegate_linux.h" | 101 #include "content/public/common/zygote_fork_delegate_linux.h" |
| 102 #endif | 102 #endif |
| 103 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 103 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 104 #include "content/zygote/zygote_main.h" | 104 #include "content/zygote/zygote_main.h" |
| 105 #endif | 105 #endif |
| 106 | 106 |
| 107 #endif // OS_POSIX | 107 #endif // OS_POSIX |
| 108 | 108 |
| 109 #if defined(OS_CHROMEOS) | |
| 110 #include "components/metrics/leak_detector/leak_detector.h" | |
| 111 #endif | |
| 112 | |
| 109 #if defined(USE_NSS_CERTS) | 113 #if defined(USE_NSS_CERTS) |
| 110 #include "crypto/nss_util.h" | 114 #include "crypto/nss_util.h" |
| 111 #endif | 115 #endif |
| 112 | 116 |
| 113 namespace content { | 117 namespace content { |
| 114 extern int GpuMain(const content::MainFunctionParams&); | 118 extern int GpuMain(const content::MainFunctionParams&); |
| 115 #if defined(ENABLE_PLUGINS) | 119 #if defined(ENABLE_PLUGINS) |
| 116 #if !defined(OS_LINUX) | 120 #if !defined(OS_LINUX) |
| 117 extern int PluginMain(const content::MainFunctionParams&); | 121 extern int PluginMain(const content::MainFunctionParams&); |
| 118 #endif | 122 #endif |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 749 // On OS X the renderer sandbox needs to be initialized later in the | 753 // On OS X the renderer sandbox needs to be initialized later in the |
| 750 // startup sequence in RendererMainPlatformDelegate::EnableSandbox(). | 754 // startup sequence in RendererMainPlatformDelegate::EnableSandbox(). |
| 751 } else { | 755 } else { |
| 752 CHECK(InitializeSandbox()); | 756 CHECK(InitializeSandbox()); |
| 753 } | 757 } |
| 754 #endif | 758 #endif |
| 755 | 759 |
| 756 if (delegate_) | 760 if (delegate_) |
| 757 delegate_->SandboxInitialized(process_type); | 761 delegate_->SandboxInitialized(process_type); |
| 758 | 762 |
| 763 #if defined (OS_CHROMEOS) | |
| 764 metrics::LeakDetector::StaticInit(); | |
|
Primiano Tucci (use gerrit)
2016/06/01 21:26:30
maybe add a comment explaining that the TLS slot n
Simon Que
2016/06/02 17:55:17
Done.
| |
| 765 #endif | |
| 766 | |
| 759 // Return -1 to indicate no early termination. | 767 // Return -1 to indicate no early termination. |
| 760 return -1; | 768 return -1; |
| 761 } | 769 } |
| 762 | 770 |
| 763 int Run() override { | 771 int Run() override { |
| 764 DCHECK(is_initialized_); | 772 DCHECK(is_initialized_); |
| 765 DCHECK(!is_shutdown_); | 773 DCHECK(!is_shutdown_); |
| 766 const base::CommandLine& command_line = | 774 const base::CommandLine& command_line = |
| 767 *base::CommandLine::ForCurrentProcess(); | 775 *base::CommandLine::ForCurrentProcess(); |
| 768 std::string process_type = | 776 std::string process_type = |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 843 | 851 |
| 844 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 852 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
| 845 }; | 853 }; |
| 846 | 854 |
| 847 // static | 855 // static |
| 848 ContentMainRunner* ContentMainRunner::Create() { | 856 ContentMainRunner* ContentMainRunner::Create() { |
| 849 return new ContentMainRunnerImpl(); | 857 return new ContentMainRunnerImpl(); |
| 850 } | 858 } |
| 851 | 859 |
| 852 } // namespace content | 860 } // namespace content |
| OLD | NEW |