| 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 "chrome/browser/chrome_browser_main_linux.h" | 5 #include "chrome/browser/chrome_browser_main_linux.h" |
| 6 | 6 |
| 7 #include <fontconfig/fontconfig.h> |
| 8 |
| 7 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 8 #include "components/breakpad/app/breakpad_linux.h" | 10 #include "components/breakpad/app/breakpad_linux.h" |
| 9 #include "components/metrics/metrics_service.h" | 11 #include "components/metrics/metrics_service.h" |
| 10 | 12 |
| 11 #if !defined(OS_CHROMEOS) | 13 #if !defined(OS_CHROMEOS) |
| 12 #include "base/linux_util.h" | 14 #include "base/linux_util.h" |
| 13 #include "chrome/browser/sxs_linux.h" | 15 #include "chrome/browser/sxs_linux.h" |
| 14 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 15 #endif | 17 #endif |
| 16 | 18 |
| 17 ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux( | 19 ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux( |
| 18 const content::MainFunctionParams& parameters) | 20 const content::MainFunctionParams& parameters) |
| 19 : ChromeBrowserMainPartsPosix(parameters) { | 21 : ChromeBrowserMainPartsPosix(parameters) { |
| 20 } | 22 } |
| 21 | 23 |
| 22 ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLinux() { | 24 ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLinux() { |
| 23 } | 25 } |
| 24 | 26 |
| 27 void ChromeBrowserMainPartsLinux::ToolkitInitialized() { |
| 28 // Explicitly initialize Fontconfig early on to prevent races later due to |
| 29 // implicit initialization in response to threads' first calls to Fontconfig: |
| 30 // http://crbug.com/404311 |
| 31 FcInit(); |
| 32 |
| 33 ChromeBrowserMainPartsPosix::ToolkitInitialized(); |
| 34 } |
| 35 |
| 25 void ChromeBrowserMainPartsLinux::PreProfileInit() { | 36 void ChromeBrowserMainPartsLinux::PreProfileInit() { |
| 26 #if !defined(OS_CHROMEOS) | 37 #if !defined(OS_CHROMEOS) |
| 27 // Needs to be called after we have chrome::DIR_USER_DATA and | 38 // Needs to be called after we have chrome::DIR_USER_DATA and |
| 28 // g_browser_process. This happens in PreCreateThreads. | 39 // g_browser_process. This happens in PreCreateThreads. |
| 29 // base::GetLinuxDistro() will initialize its value if needed. | 40 // base::GetLinuxDistro() will initialize its value if needed. |
| 30 content::BrowserThread::PostBlockingPoolTask( | 41 content::BrowserThread::PostBlockingPoolTask( |
| 31 FROM_HERE, | 42 FROM_HERE, |
| 32 base::Bind(base::IgnoreResult(&base::GetLinuxDistro))); | 43 base::Bind(base::IgnoreResult(&base::GetLinuxDistro))); |
| 33 | 44 |
| 34 content::BrowserThread::PostBlockingPoolTask( | 45 content::BrowserThread::PostBlockingPoolTask( |
| 35 FROM_HERE, | 46 FROM_HERE, |
| 36 base::Bind(&sxs_linux::AddChannelMarkToUserDataDir)); | 47 base::Bind(&sxs_linux::AddChannelMarkToUserDataDir)); |
| 37 #endif | 48 #endif |
| 38 | 49 |
| 39 ChromeBrowserMainPartsPosix::PreProfileInit(); | 50 ChromeBrowserMainPartsPosix::PreProfileInit(); |
| 40 } | 51 } |
| 41 | 52 |
| 42 void ChromeBrowserMainPartsLinux::PostProfileInit() { | 53 void ChromeBrowserMainPartsLinux::PostProfileInit() { |
| 43 ChromeBrowserMainPartsPosix::PostProfileInit(); | 54 ChromeBrowserMainPartsPosix::PostProfileInit(); |
| 44 | 55 |
| 45 g_browser_process->metrics_service()->RecordBreakpadRegistration( | 56 g_browser_process->metrics_service()->RecordBreakpadRegistration( |
| 46 breakpad::IsCrashReporterEnabled()); | 57 breakpad::IsCrashReporterEnabled()); |
| 47 } | 58 } |
| OLD | NEW |