Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: chrome/browser/chrome_browser_main_linux.cc

Issue 297023002: Cleanup: Convert chrome_browser_main_linux.cc to use the blocking thread pool. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/sxs_linux.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdlib.h>
8
9 #include "base/command_line.h"
10 #include "base/linux_util.h"
11 #include "base/prefs/pref_service.h"
12 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/metrics/metrics_service.h" 8 #include "chrome/browser/metrics/metrics_service.h"
14 #include "chrome/common/chrome_switches.h"
15 #include "chrome/common/env_vars.h"
16 #include "chrome/common/pref_names.h"
17 #include "components/breakpad/app/breakpad_linux.h" 9 #include "components/breakpad/app/breakpad_linux.h"
18 10
19 #if !defined(OS_CHROMEOS) 11 #if !defined(OS_CHROMEOS)
12 #include "base/linux_util.h"
20 #include "chrome/browser/sxs_linux.h" 13 #include "chrome/browser/sxs_linux.h"
21 #include "content/public/browser/browser_thread.h" 14 #include "content/public/browser/browser_thread.h"
22 #endif 15 #endif
23 16
24 namespace {
25
26 #if !defined(OS_CHROMEOS)
27 void GetLinuxDistroCallback() {
28 base::GetLinuxDistro(); // Initialize base::linux_distro if needed.
29 }
30 #endif
31
32 } // namespace
33
34 ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux( 17 ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux(
35 const content::MainFunctionParams& parameters) 18 const content::MainFunctionParams& parameters)
36 : ChromeBrowserMainPartsPosix(parameters) { 19 : ChromeBrowserMainPartsPosix(parameters) {
37 } 20 }
38 21
39 ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLinux() { 22 ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLinux() {
40 } 23 }
41 24
42 void ChromeBrowserMainPartsLinux::PreProfileInit() { 25 void ChromeBrowserMainPartsLinux::PreProfileInit() {
43 #if !defined(OS_CHROMEOS) 26 #if !defined(OS_CHROMEOS)
44 // Needs to be called after we have chrome::DIR_USER_DATA and 27 // Needs to be called after we have chrome::DIR_USER_DATA and
45 // g_browser_process. This happens in PreCreateThreads. 28 // g_browser_process. This happens in PreCreateThreads.
46 content::BrowserThread::PostTask(content::BrowserThread::FILE, 29 // base::GetLinuxDistro() will initialize its value if needed.
47 FROM_HERE, 30 content::BrowserThread::PostBlockingPoolTask(
48 base::Bind(&GetLinuxDistroCallback)); 31 FROM_HERE,
32 base::Bind(base::IgnoreResult(&base::GetLinuxDistro)));
49 33
50 content::BrowserThread::PostTask( 34 content::BrowserThread::PostBlockingPoolTask(
51 content::BrowserThread::FILE,
52 FROM_HERE, 35 FROM_HERE,
53 base::Bind(&sxs_linux::AddChannelMarkToUserDataDir)); 36 base::Bind(&sxs_linux::AddChannelMarkToUserDataDir));
54 #endif 37 #endif
55 38
56 ChromeBrowserMainPartsPosix::PreProfileInit(); 39 ChromeBrowserMainPartsPosix::PreProfileInit();
57 } 40 }
58 41
59 void ChromeBrowserMainPartsLinux::PostProfileInit() { 42 void ChromeBrowserMainPartsLinux::PostProfileInit() {
60 ChromeBrowserMainPartsPosix::PostProfileInit(); 43 ChromeBrowserMainPartsPosix::PostProfileInit();
61 44
62 g_browser_process->metrics_service()->RecordBreakpadRegistration( 45 g_browser_process->metrics_service()->RecordBreakpadRegistration(
63 breakpad::IsCrashReporterEnabled()); 46 breakpad::IsCrashReporterEnabled());
64 } 47 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sxs_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698