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/shell/app/shell_main_delegate.h" | 5 #include "content/shell/app/shell_main_delegate.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
| 13 #include "base/logging.h" | |
| 14 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 15 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 16 #include "cc/base/switches.h" | 15 #include "cc/base/switches.h" |
| 17 #include "content/common/content_constants_internal.h" | 16 #include "content/common/content_constants_internal.h" |
| 18 #include "content/public/browser/browser_main_runner.h" | 17 #include "content/public/browser/browser_main_runner.h" |
| 19 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
| 20 #include "content/public/common/url_constants.h" | 19 #include "content/public/common/url_constants.h" |
| 21 #include "content/public/test/layouttest_support.h" | 20 #include "content/public/test/layouttest_support.h" |
| 22 #include "content/public/test/ppapi_test_utils.h" | 21 #include "content/public/test/ppapi_test_utils.h" |
| 23 #include "content/shell/app/blink_test_platform_support.h" | 22 #include "content/shell/app/blink_test_platform_support.h" |
| 24 #include "content/shell/app/shell_crash_reporter_client.h" | 23 #include "content/shell/app/shell_crash_reporter_client.h" |
| 25 #include "content/shell/browser/layout_test/layout_test_browser_main.h" | 24 #include "content/shell/browser/layout_test/layout_test_browser_main.h" |
| 26 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h " | 25 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h " |
| 27 #include "content/shell/browser/shell_browser_main.h" | 26 #include "content/shell/browser/shell_browser_main.h" |
| 28 #include "content/shell/browser/shell_content_browser_client.h" | 27 #include "content/shell/browser/shell_content_browser_client.h" |
| 29 #include "content/shell/common/layout_test/layout_test_content_client.h" | 28 #include "content/shell/common/layout_test/layout_test_content_client.h" |
| 30 #include "content/shell/common/layout_test/layout_test_switches.h" | 29 #include "content/shell/common/layout_test/layout_test_switches.h" |
| 31 #include "content/shell/common/shell_content_client.h" | 30 #include "content/shell/common/shell_content_client.h" |
| 32 #include "content/shell/common/shell_switches.h" | |
| 33 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client .h" | 31 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client .h" |
| 34 #include "content/shell/renderer/shell_content_renderer_client.h" | 32 #include "content/shell/renderer/shell_content_renderer_client.h" |
| 35 #include "content/shell/utility/shell_content_utility_client.h" | 33 #include "content/shell/utility/shell_content_utility_client.h" |
| 36 #include "media/base/media_switches.h" | 34 #include "media/base/media_switches.h" |
| 37 #include "media/base/mime_util.h" | 35 #include "media/base/mime_util.h" |
| 38 #include "net/cookies/cookie_monster.h" | 36 #include "net/cookies/cookie_monster.h" |
| 39 #include "ui/base/resource/resource_bundle.h" | 37 #include "ui/base/resource/resource_bundle.h" |
| 40 #include "ui/base/ui_base_paths.h" | 38 #include "ui/base/ui_base_paths.h" |
| 41 #include "ui/base/ui_base_switches.h" | 39 #include "ui/base/ui_base_switches.h" |
| 42 #include "ui/display/display_switches.h" | 40 #include "ui/display/display_switches.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 // "default_flags"=dword:00000001 | 91 // "default_flags"=dword:00000001 |
| 94 // "default_level"=dword:00000004 | 92 // "default_level"=dword:00000004 |
| 95 // @="Content Shell" | 93 // @="Content Shell" |
| 96 | 94 |
| 97 // {6A3E50A4-7E15-4099-8413-EC94D8C2A4B6} | 95 // {6A3E50A4-7E15-4099-8413-EC94D8C2A4B6} |
| 98 const GUID kContentShellProviderName = { | 96 const GUID kContentShellProviderName = { |
| 99 0x6a3e50a4, 0x7e15, 0x4099, | 97 0x6a3e50a4, 0x7e15, 0x4099, |
| 100 { 0x84, 0x13, 0xec, 0x94, 0xd8, 0xc2, 0xa4, 0xb6 } }; | 98 { 0x84, 0x13, 0xec, 0x94, 0xd8, 0xc2, 0xa4, 0xb6 } }; |
| 101 #endif | 99 #endif |
| 102 | 100 |
| 103 void InitLogging() { | |
| 104 base::FilePath log_filename; | |
| 105 PathService::Get(base::DIR_EXE, &log_filename); | |
| 106 log_filename = log_filename.AppendASCII("content_shell.log"); | |
| 107 logging::LoggingSettings settings; | |
| 108 settings.logging_dest = logging::LOG_TO_ALL; | |
| 109 settings.log_file = log_filename.value().c_str(); | |
| 110 settings.delete_old = logging::DELETE_OLD_LOG_FILE; | |
| 111 logging::InitLogging(settings); | |
| 112 logging::SetLogItems(true, true, true, true); | |
| 113 } | |
| 114 | |
| 115 } // namespace | 101 } // namespace |
| 116 | 102 |
| 117 namespace content { | 103 namespace content { |
| 118 | 104 |
| 119 ShellMainDelegate::ShellMainDelegate() { | 105 ShellMainDelegate::ShellMainDelegate() { |
| 120 } | 106 } |
| 121 | 107 |
| 122 ShellMainDelegate::~ShellMainDelegate() { | 108 ShellMainDelegate::~ShellMainDelegate() { |
| 123 } | 109 } |
| 124 | 110 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 135 v8_breakpad_support::SetUp(); | 121 v8_breakpad_support::SetUp(); |
| 136 #endif | 122 #endif |
| 137 #if defined(OS_MACOSX) | 123 #if defined(OS_MACOSX) |
| 138 // Needs to happen before InitializeResourceBundle() and before | 124 // Needs to happen before InitializeResourceBundle() and before |
| 139 // BlinkTestPlatformInitialize() are called. | 125 // BlinkTestPlatformInitialize() are called. |
| 140 OverrideFrameworkBundlePath(); | 126 OverrideFrameworkBundlePath(); |
| 141 OverrideChildProcessPath(); | 127 OverrideChildProcessPath(); |
| 142 EnsureCorrectResolutionSettings(); | 128 EnsureCorrectResolutionSettings(); |
| 143 #endif // OS_MACOSX | 129 #endif // OS_MACOSX |
| 144 | 130 |
| 145 InitLogging(); | |
|
Dirk Pranke
2016/11/29 02:20:48
You should probably leave the logging code in and
Jack Bates
2016/12/01 17:47:38
Done.
| |
| 146 if (command_line.HasSwitch(switches::kCheckLayoutTestSysDeps)) { | 131 if (command_line.HasSwitch(switches::kCheckLayoutTestSysDeps)) { |
| 147 // If CheckLayoutSystemDeps succeeds, we don't exit early. Instead we | 132 // If CheckLayoutSystemDeps succeeds, we don't exit early. Instead we |
| 148 // continue and try to load the fonts in BlinkTestPlatformInitialize | 133 // continue and try to load the fonts in BlinkTestPlatformInitialize |
| 149 // below, and then try to bring up the rest of the content module. | 134 // below, and then try to bring up the rest of the content module. |
| 150 if (!CheckLayoutSystemDeps()) { | 135 if (!CheckLayoutSystemDeps()) { |
| 151 *exit_code = 1; | 136 *exit_code = 1; |
| 152 return true; | 137 return true; |
| 153 } | 138 } |
| 154 } | 139 } |
| 155 | 140 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 366 | 351 |
| 367 return renderer_client_.get(); | 352 return renderer_client_.get(); |
| 368 } | 353 } |
| 369 | 354 |
| 370 ContentUtilityClient* ShellMainDelegate::CreateContentUtilityClient() { | 355 ContentUtilityClient* ShellMainDelegate::CreateContentUtilityClient() { |
| 371 utility_client_.reset(new ShellContentUtilityClient); | 356 utility_client_.reset(new ShellContentUtilityClient); |
| 372 return utility_client_.get(); | 357 return utility_client_.get(); |
| 373 } | 358 } |
| 374 | 359 |
| 375 } // namespace content | 360 } // namespace content |
| OLD | NEW |