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/shell_main_delegate.h" | 5 #include "content/shell/shell_main_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 0x6a3e50a4, 0x7e15, 0x4099, | 50 0x6a3e50a4, 0x7e15, 0x4099, |
51 { 0x84, 0x13, 0xec, 0x94, 0xd8, 0xc2, 0xa4, 0xb6 } }; | 51 { 0x84, 0x13, 0xec, 0x94, 0xd8, 0xc2, 0xa4, 0xb6 } }; |
52 #endif | 52 #endif |
53 | 53 |
54 void InitLogging() { | 54 void InitLogging() { |
55 FilePath log_filename; | 55 FilePath log_filename; |
56 PathService::Get(base::DIR_EXE, &log_filename); | 56 PathService::Get(base::DIR_EXE, &log_filename); |
57 log_filename = log_filename.AppendASCII("content_shell.log"); | 57 log_filename = log_filename.AppendASCII("content_shell.log"); |
58 logging::InitLogging( | 58 logging::InitLogging( |
59 log_filename.value().c_str(), | 59 log_filename.value().c_str(), |
60 logging::LOG_ONLY_TO_FILE, | 60 logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG, |
61 logging::LOCK_LOG_FILE, | 61 logging::LOCK_LOG_FILE, |
62 logging::DELETE_OLD_LOG_FILE, | 62 logging::DELETE_OLD_LOG_FILE, |
63 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); | 63 logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS); |
64 logging::SetLogItems(true, true, true, true); | 64 logging::SetLogItems(true, true, true, true); |
65 } | 65 } |
66 | 66 |
67 } // namespace | 67 } // namespace |
68 | 68 |
69 namespace content { | 69 namespace content { |
70 | 70 |
71 ShellMainDelegate::ShellMainDelegate() { | 71 ShellMainDelegate::ShellMainDelegate() { |
72 } | 72 } |
73 | 73 |
74 ShellMainDelegate::~ShellMainDelegate() { | 74 ShellMainDelegate::~ShellMainDelegate() { |
75 #if defined(OS_ANDROID) | 75 #if defined(OS_ANDROID) |
76 NOTREACHED(); | 76 NOTREACHED(); |
77 #endif | 77 #endif |
78 } | 78 } |
79 | 79 |
80 bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { | 80 bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { |
81 #if defined(OS_WIN) | 81 #if defined(OS_WIN) |
82 // Enable trace control and transport through event tracing for Windows. | 82 // Enable trace control and transport through event tracing for Windows. |
83 logging::LogEventProvider::Initialize(kContentShellProviderName); | 83 logging::LogEventProvider::Initialize(kContentShellProviderName); |
84 #endif | 84 #endif |
85 | 85 |
| 86 InitLogging(); |
86 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { | 87 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { |
87 InitLogging(); | |
88 CommandLine::ForCurrentProcess()->AppendSwitch( | 88 CommandLine::ForCurrentProcess()->AppendSwitch( |
89 switches::kAllowFileAccessFromFiles); | 89 switches::kAllowFileAccessFromFiles); |
90 } | 90 } |
91 SetContentClient(&content_client_); | 91 SetContentClient(&content_client_); |
92 return false; | 92 return false; |
93 } | 93 } |
94 | 94 |
95 void ShellMainDelegate::PreSandboxStartup() { | 95 void ShellMainDelegate::PreSandboxStartup() { |
96 #if defined(OS_MACOSX) | 96 #if defined(OS_MACOSX) |
97 OverrideFrameworkBundlePath(); | 97 OverrideFrameworkBundlePath(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 browser_client_.reset(new ShellContentBrowserClient); | 157 browser_client_.reset(new ShellContentBrowserClient); |
158 return browser_client_.get(); | 158 return browser_client_.get(); |
159 } | 159 } |
160 | 160 |
161 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { | 161 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { |
162 renderer_client_.reset(new ShellContentRendererClient); | 162 renderer_client_.reset(new ShellContentRendererClient); |
163 return renderer_client_.get(); | 163 return renderer_client_.get(); |
164 } | 164 } |
165 | 165 |
166 } // namespace content | 166 } // namespace content |
OLD | NEW |