OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/browser_shutdown.h" | 9 #include "chrome/browser/browser_shutdown.h" |
10 #include "chrome/browser/metrics/metrics_service.h" | 10 #include "chrome/browser/metrics/metrics_service.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 bool g_in_x11_io_error_handler = false; | 26 bool g_in_x11_io_error_handler = false; |
27 | 27 |
28 // Number of seconds to wait for UI thread to get an IO error if we get it on | 28 // Number of seconds to wait for UI thread to get an IO error if we get it on |
29 // the background thread. | 29 // the background thread. |
30 const int kWaitForUIThreadSeconds = 10; | 30 const int kWaitForUIThreadSeconds = 10; |
31 | 31 |
32 int BrowserX11ErrorHandler(Display* d, XErrorEvent* error) { | 32 int BrowserX11ErrorHandler(Display* d, XErrorEvent* error) { |
33 if (!g_in_x11_io_error_handler) | 33 if (!g_in_x11_io_error_handler) |
34 MessageLoop::current()->PostTask( | 34 MessageLoop::current()->PostTask( |
35 FROM_HERE, | 35 FROM_HERE, |
36 base::Bind(ui::LogErrorEventDescription, d, *error)); | 36 base::Bind(&ui::LogErrorEventDescription, d, *error)); |
37 return 0; | 37 return 0; |
38 } | 38 } |
39 | 39 |
40 | 40 |
41 // This function is used to help us diagnose crash dumps that happen | 41 // This function is used to help us diagnose crash dumps that happen |
42 // during the shutdown process. | 42 // during the shutdown process. |
43 NOINLINE void WaitingForUIThreadToHandleIOError() { | 43 NOINLINE void WaitingForUIThreadToHandleIOError() { |
44 // Ensure function isn't optimized away. | 44 // Ensure function isn't optimized away. |
45 asm(""); | 45 asm(""); |
46 sleep(kWaitForUIThreadSeconds); | 46 sleep(kWaitForUIThreadSeconds); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 int DoUninstallTasks(bool chrome_still_running) { | 90 int DoUninstallTasks(bool chrome_still_running) { |
91 return content::RESULT_CODE_NORMAL_EXIT; | 91 return content::RESULT_CODE_NORMAL_EXIT; |
92 } | 92 } |
93 | 93 |
94 void SetBrowserX11ErrorHandlers() { | 94 void SetBrowserX11ErrorHandlers() { |
95 // Set up error handlers to make sure profile gets written if X server | 95 // Set up error handlers to make sure profile gets written if X server |
96 // goes away. | 96 // goes away. |
97 ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler); | 97 ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler); |
98 } | 98 } |
OLD | NEW |