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.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/debugger.h" | 8 #include "base/debug/debugger.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/browser_shutdown.h" | 10 #include "chrome/browser/browser_shutdown.h" |
| 11 #include "chrome/browser/lifetime/application_lifetime.h" |
11 #include "chrome/browser/metrics/metrics_service.h" | 12 #include "chrome/browser/metrics/metrics_service.h" |
12 #include "chrome/browser/ui/browser_list.h" | |
13 #include "chrome/common/chrome_result_codes.h" | 13 #include "chrome/common/chrome_result_codes.h" |
14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
15 #include "ui/base/x/x11_util.h" | 15 #include "ui/base/x/x11_util.h" |
16 #include "ui/base/x/x11_util_internal.h" | 16 #include "ui/base/x/x11_util_internal.h" |
17 | 17 |
18 #if defined(USE_LINUX_BREAKPAD) | 18 #if defined(USE_LINUX_BREAKPAD) |
19 #include "chrome/app/breakpad_linuxish.h" | 19 #include "chrome/app/breakpad_linuxish.h" |
20 #endif | 20 #endif |
21 | 21 |
22 using content::BrowserThread; | 22 using content::BrowserThread; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // tripping an error. Doing it through a function so that we'll be able | 54 // tripping an error. Doing it through a function so that we'll be able |
55 // to see it in any crash dumps. | 55 // to see it in any crash dumps. |
56 WaitingForUIThreadToHandleIOError(); | 56 WaitingForUIThreadToHandleIOError(); |
57 return 0; | 57 return 0; |
58 } | 58 } |
59 // If there's an IO error it likely means the X server has gone away | 59 // If there's an IO error it likely means the X server has gone away |
60 if (!g_in_x11_io_error_handler) { | 60 if (!g_in_x11_io_error_handler) { |
61 g_in_x11_io_error_handler = true; | 61 g_in_x11_io_error_handler = true; |
62 LOG(ERROR) << "X IO Error detected"; | 62 LOG(ERROR) << "X IO Error detected"; |
63 browser_shutdown::SetShuttingDownWithoutClosingBrowsers(true); | 63 browser_shutdown::SetShuttingDownWithoutClosingBrowsers(true); |
64 BrowserList::SessionEnding(); | 64 browser::SessionEnding(); |
65 } | 65 } |
66 | 66 |
67 return 0; | 67 return 0; |
68 } | 68 } |
69 | 69 |
70 } // namespace | 70 } // namespace |
71 | 71 |
72 void RecordBreakpadStatusUMA(MetricsService* metrics) { | 72 void RecordBreakpadStatusUMA(MetricsService* metrics) { |
73 #if defined(USE_LINUX_BREAKPAD) | 73 #if defined(USE_LINUX_BREAKPAD) |
74 metrics->RecordBreakpadRegistration(IsCrashReporterEnabled()); | 74 metrics->RecordBreakpadRegistration(IsCrashReporterEnabled()); |
(...skipping 15 matching lines...) Expand all Loading... |
90 | 90 |
91 int DoUninstallTasks(bool chrome_still_running) { | 91 int DoUninstallTasks(bool chrome_still_running) { |
92 return content::RESULT_CODE_NORMAL_EXIT; | 92 return content::RESULT_CODE_NORMAL_EXIT; |
93 } | 93 } |
94 | 94 |
95 void SetBrowserX11ErrorHandlers() { | 95 void SetBrowserX11ErrorHandlers() { |
96 // Set up error handlers to make sure profile gets written if X server | 96 // Set up error handlers to make sure profile gets written if X server |
97 // goes away. | 97 // goes away. |
98 ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler); | 98 ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler); |
99 } | 99 } |
OLD | NEW |