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 #if !defined(OS_CHROMEOS) | 7 #if !defined(OS_CHROMEOS) |
8 #include "chrome/browser/storage_monitor/storage_monitor_linux.h" | |
9 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
10 #endif | 9 #endif |
11 | 10 |
12 #if defined(USE_LINUX_BREAKPAD) | 11 #if defined(USE_LINUX_BREAKPAD) |
13 #include <stdlib.h> | 12 #include <stdlib.h> |
14 | 13 |
15 #include "base/command_line.h" | 14 #include "base/command_line.h" |
16 #include "base/linux_util.h" | 15 #include "base/linux_util.h" |
17 #include "base/prefs/pref_service.h" | 16 #include "base/prefs/pref_service.h" |
18 #include "chrome/app/breakpad_linux.h" | 17 #include "chrome/app/breakpad_linux.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // g_browser_process. This happens in PreCreateThreads. | 119 // g_browser_process. This happens in PreCreateThreads. |
121 content::BrowserThread::PostTask(content::BrowserThread::FILE, | 120 content::BrowserThread::PostTask(content::BrowserThread::FILE, |
122 FROM_HERE, | 121 FROM_HERE, |
123 base::Bind(&GetLinuxDistroCallback)); | 122 base::Bind(&GetLinuxDistroCallback)); |
124 #endif | 123 #endif |
125 | 124 |
126 if (IsCrashReportingEnabled(local_state())) | 125 if (IsCrashReportingEnabled(local_state())) |
127 InitCrashReporter(); | 126 InitCrashReporter(); |
128 #endif | 127 #endif |
129 | 128 |
130 #if !defined(OS_CHROMEOS) | |
131 const base::FilePath kDefaultMtabPath("/etc/mtab"); | |
132 storage_monitor_.reset(new chrome::StorageMonitorLinux(kDefaultMtabPath)); | |
133 #endif | |
134 | |
135 ChromeBrowserMainPartsPosix::PreProfileInit(); | 129 ChromeBrowserMainPartsPosix::PreProfileInit(); |
136 } | 130 } |
137 | 131 |
138 void ChromeBrowserMainPartsLinux::PostProfileInit() { | 132 void ChromeBrowserMainPartsLinux::PostProfileInit() { |
139 ChromeBrowserMainPartsPosix::PostProfileInit(); | 133 ChromeBrowserMainPartsPosix::PostProfileInit(); |
140 | 134 |
141 #if defined(USE_LINUX_BREAKPAD) | 135 #if defined(USE_LINUX_BREAKPAD) |
142 g_browser_process->metrics_service()->RecordBreakpadRegistration( | 136 g_browser_process->metrics_service()->RecordBreakpadRegistration( |
143 IsCrashReporterEnabled()); | 137 IsCrashReporterEnabled()); |
144 #else | 138 #else |
145 g_browser_process->metrics_service()->RecordBreakpadRegistration(false); | 139 g_browser_process->metrics_service()->RecordBreakpadRegistration(false); |
146 #endif | 140 #endif |
147 } | 141 } |
148 | |
149 void ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() { | |
150 ChromeBrowserMainPartsPosix::PostMainMessageLoopRun(); | |
151 | |
152 #if !defined(OS_CHROMEOS) | |
153 // Delete it now. Otherwise the FILE thread would be gone when we try to | |
154 // release it in the dtor and Valgrind would report a leak on almost every | |
155 // single browser_test. | |
156 storage_monitor_.reset(); | |
157 #endif | |
158 } | |
OLD | NEW |