OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/engine/app/blimp_content_main_delegate.h" | 5 #include "blimp/engine/app/blimp_content_main_delegate.h" |
6 | 6 |
7 #include "base/files/file.h" | 7 #include "base/files/file.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/logging.h" |
9 #include "base/path_service.h" | 10 #include "base/path_service.h" |
10 #include "blimp/engine/browser/blimp_content_browser_client.h" | 11 #include "blimp/engine/browser/blimp_content_browser_client.h" |
11 #include "blimp/engine/renderer/blimp_content_renderer_client.h" | 12 #include "blimp/engine/renderer/blimp_content_renderer_client.h" |
12 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
13 | 14 |
14 namespace blimp { | 15 namespace blimp { |
15 namespace engine { | 16 namespace engine { |
| 17 namespace { |
| 18 void InitLogging() { |
| 19 logging::LoggingSettings settings; |
| 20 base::FilePath log_filename; |
| 21 PathService::Get(base::DIR_EXE, &log_filename); |
| 22 log_filename = log_filename.AppendASCII("blimp_engine.log"); |
| 23 settings.logging_dest = logging::LOG_TO_ALL; |
| 24 settings.log_file = log_filename.value().c_str(); |
| 25 settings.delete_old = logging::DELETE_OLD_LOG_FILE; |
| 26 logging::InitLogging(settings); |
| 27 logging::SetLogItems(true, // Process ID |
| 28 true, // Thread ID |
| 29 true, // Timestamp |
| 30 false); // Tick count |
| 31 } |
| 32 } // namespace |
16 | 33 |
17 BlimpContentMainDelegate::BlimpContentMainDelegate() {} | 34 BlimpContentMainDelegate::BlimpContentMainDelegate() {} |
18 | 35 |
19 BlimpContentMainDelegate::~BlimpContentMainDelegate() {} | 36 BlimpContentMainDelegate::~BlimpContentMainDelegate() {} |
20 | 37 |
21 bool BlimpContentMainDelegate::BasicStartupComplete(int* exit_code) { | 38 bool BlimpContentMainDelegate::BasicStartupComplete(int* exit_code) { |
| 39 InitLogging(); |
22 content::SetContentClient(&content_client_); | 40 content::SetContentClient(&content_client_); |
23 return false; | 41 return false; |
24 } | 42 } |
25 | 43 |
26 void BlimpContentMainDelegate::PreSandboxStartup() { | 44 void BlimpContentMainDelegate::PreSandboxStartup() { |
27 InitializeResourceBundle(); | 45 InitializeResourceBundle(); |
28 } | 46 } |
29 | 47 |
30 void BlimpContentMainDelegate::InitializeResourceBundle() { | 48 void BlimpContentMainDelegate::InitializeResourceBundle() { |
31 base::FilePath pak_file; | 49 base::FilePath pak_file; |
(...skipping 12 matching lines...) Expand all Loading... |
44 | 62 |
45 content::ContentRendererClient* | 63 content::ContentRendererClient* |
46 BlimpContentMainDelegate::CreateContentRendererClient() { | 64 BlimpContentMainDelegate::CreateContentRendererClient() { |
47 DCHECK(!renderer_client_); | 65 DCHECK(!renderer_client_); |
48 renderer_client_.reset(new BlimpContentRendererClient); | 66 renderer_client_.reset(new BlimpContentRendererClient); |
49 return renderer_client_.get(); | 67 return renderer_client_.get(); |
50 } | 68 } |
51 | 69 |
52 } // namespace engine | 70 } // namespace engine |
53 } // namespace blimp | 71 } // namespace blimp |
OLD | NEW |