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" | 13 #include "base/logging.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "cc/base/switches.h" | 15 #include "cc/base/switches.h" |
16 #include "content/public/browser/browser_main_runner.h" | 16 #include "content/public/browser/browser_main_runner.h" |
17 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
18 #include "content/public/common/url_constants.h" | 18 #include "content/public/common/url_constants.h" |
19 #include "content/public/test/layouttest_support.h" | 19 #include "content/public/test/layouttest_support.h" |
20 #include "content/shell/app/blink_test_platform_support.h" | |
20 #include "content/shell/app/shell_crash_reporter_client.h" | 21 #include "content/shell/app/shell_crash_reporter_client.h" |
21 #include "content/shell/app/webkit_test_platform_support.h" | |
22 #include "content/shell/browser/shell_browser_main.h" | 22 #include "content/shell/browser/shell_browser_main.h" |
23 #include "content/shell/browser/shell_content_browser_client.h" | 23 #include "content/shell/browser/shell_content_browser_client.h" |
24 #include "content/shell/common/shell_switches.h" | 24 #include "content/shell/common/shell_switches.h" |
25 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client .h" | 25 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client .h" |
26 #include "content/shell/renderer/shell_content_renderer_client.h" | 26 #include "content/shell/renderer/shell_content_renderer_client.h" |
27 #include "media/base/media_switches.h" | 27 #include "media/base/media_switches.h" |
28 #include "net/cookies/cookie_monster.h" | 28 #include "net/cookies/cookie_monster.h" |
29 #include "ui/base/resource/resource_bundle.h" | 29 #include "ui/base/resource/resource_bundle.h" |
30 #include "ui/base/ui_base_paths.h" | 30 #include "ui/base/ui_base_paths.h" |
31 #include "ui/base/ui_base_switches.h" | 31 #include "ui/base/ui_base_switches.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
49 #endif | 49 #endif |
50 | 50 |
51 #if defined(OS_MACOSX) | 51 #if defined(OS_MACOSX) |
52 #include "base/mac/os_crash_dumps.h" | 52 #include "base/mac/os_crash_dumps.h" |
53 #include "components/crash/app/breakpad_mac.h" | 53 #include "components/crash/app/breakpad_mac.h" |
54 #include "content/shell/app/paths_mac.h" | 54 #include "content/shell/app/paths_mac.h" |
55 #include "content/shell/app/shell_main_delegate_mac.h" | 55 #include "content/shell/app/shell_main_delegate_mac.h" |
56 #endif // OS_MACOSX | 56 #endif // OS_MACOSX |
57 | 57 |
58 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
59 #include <windows.h> | |
Avi (use Gerrit)
2014/10/15 22:42:27
Why this change?
tfarina
2014/10/15 22:44:28
ops, that was not intended, will revert.
tfarina
2014/10/15 22:47:53
Done.
tfarina
2014/10/15 22:47:53
Done.
| |
59 #include <initguid.h> | 60 #include <initguid.h> |
60 #include <windows.h> | |
61 #include "base/logging_win.h" | 61 #include "base/logging_win.h" |
62 #include "components/crash/app/breakpad_win.h" | 62 #include "components/crash/app/breakpad_win.h" |
63 #include "content/shell/common/v8_breakpad_support_win.h" | 63 #include "content/shell/common/v8_breakpad_support_win.h" |
64 #endif | 64 #endif |
65 | 65 |
66 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 66 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
67 #include "components/crash/app/breakpad_linux.h" | 67 #include "components/crash/app/breakpad_linux.h" |
68 #endif | 68 #endif |
69 | 69 |
70 namespace { | 70 namespace { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 | 113 |
114 bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { | 114 bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { |
115 #if defined(OS_WIN) | 115 #if defined(OS_WIN) |
116 // Enable trace control and transport through event tracing for Windows. | 116 // Enable trace control and transport through event tracing for Windows. |
117 logging::LogEventProvider::Initialize(kContentShellProviderName); | 117 logging::LogEventProvider::Initialize(kContentShellProviderName); |
118 | 118 |
119 v8_breakpad_support::SetUp(); | 119 v8_breakpad_support::SetUp(); |
120 #endif | 120 #endif |
121 #if defined(OS_MACOSX) | 121 #if defined(OS_MACOSX) |
122 // Needs to happen before InitializeResourceBundle() and before | 122 // Needs to happen before InitializeResourceBundle() and before |
123 // WebKitTestPlatformInitialize() are called. | 123 // BlinkTestPlatformInitialize() are called. |
124 OverrideFrameworkBundlePath(); | 124 OverrideFrameworkBundlePath(); |
125 OverrideChildProcessPath(); | 125 OverrideChildProcessPath(); |
126 EnsureCorrectResolutionSettings(); | 126 EnsureCorrectResolutionSettings(); |
127 #endif // OS_MACOSX | 127 #endif // OS_MACOSX |
128 | 128 |
129 InitLogging(); | 129 InitLogging(); |
130 CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 130 CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
131 if (command_line.HasSwitch(switches::kCheckLayoutTestSysDeps)) { | 131 if (command_line.HasSwitch(switches::kCheckLayoutTestSysDeps)) { |
132 // If CheckLayoutSystemDeps succeeds, we don't exit early. Instead we | 132 // If CheckLayoutSystemDeps succeeds, we don't exit early. Instead we |
133 // continue and try to load the fonts in WebKitTestPlatformInitialize | 133 // continue and try to load the fonts in BlinkTestPlatformInitialize |
134 // 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. |
135 if (!CheckLayoutSystemDeps()) { | 135 if (!CheckLayoutSystemDeps()) { |
136 if (exit_code) | 136 if (exit_code) |
137 *exit_code = 1; | 137 *exit_code = 1; |
138 return true; | 138 return true; |
139 } | 139 } |
140 } | 140 } |
141 | 141 |
142 if (command_line.HasSwitch(switches::kDumpRenderTree)) { | 142 if (command_line.HasSwitch(switches::kDumpRenderTree)) { |
143 EnableBrowserLayoutTestMode(); | 143 EnableBrowserLayoutTestMode(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
182 | 182 |
183 command_line.AppendSwitchASCII(switches::kHostResolverRules, | 183 command_line.AppendSwitchASCII(switches::kHostResolverRules, |
184 "MAP *.test 127.0.0.1"); | 184 "MAP *.test 127.0.0.1"); |
185 | 185 |
186 // Unless/until WebM files are added to the media layout tests, we need to | 186 // Unless/until WebM files are added to the media layout tests, we need to |
187 // avoid removing MP4/H264/AAC so that layout tests can run on Android. | 187 // avoid removing MP4/H264/AAC so that layout tests can run on Android. |
188 #if !defined(OS_ANDROID) | 188 #if !defined(OS_ANDROID) |
189 net::RemoveProprietaryMediaTypesAndCodecsForTests(); | 189 net::RemoveProprietaryMediaTypesAndCodecsForTests(); |
190 #endif | 190 #endif |
191 | 191 |
192 if (!WebKitTestPlatformInitialize()) { | 192 if (!BlinkTestPlatformInitialize()) { |
193 if (exit_code) | 193 if (exit_code) |
194 *exit_code = 1; | 194 *exit_code = 1; |
195 return true; | 195 return true; |
196 } | 196 } |
197 } | 197 } |
198 SetContentClient(&content_client_); | 198 SetContentClient(&content_client_); |
199 return false; | 199 return false; |
200 } | 200 } |
201 | 201 |
202 void ShellMainDelegate::PreSandboxStartup() { | 202 void ShellMainDelegate::PreSandboxStartup() { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
309 | 309 |
310 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { | 310 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { |
311 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 311 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
312 renderer_client_.reset(new LayoutTestContentRendererClient); | 312 renderer_client_.reset(new LayoutTestContentRendererClient); |
313 else | 313 else |
314 renderer_client_.reset(new ShellContentRendererClient); | 314 renderer_client_.reset(new ShellContentRendererClient); |
315 return renderer_client_.get(); | 315 return renderer_client_.get(); |
316 } | 316 } |
317 | 317 |
318 } // namespace content | 318 } // namespace content |
OLD | NEW |