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

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

Issue 10933113: x11: Unset the X11 error handlers when the message-loop starts getting destroyed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
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.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"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 browser::SessionEnding(); 64 browser::SessionEnding();
65 } 65 }
66 66
67 return 0; 67 return 0;
68 } 68 }
69 69
70 int X11EmptyErrorHandler(Display* d, XErrorEvent* error) {
71 return 0;
72 }
73
74 int X11EmptyIOErrorHandler(Display* d) {
75 return 0;
76 }
77
70 } // namespace 78 } // namespace
71 79
72 void RecordBreakpadStatusUMA(MetricsService* metrics) { 80 void RecordBreakpadStatusUMA(MetricsService* metrics) {
73 #if defined(USE_LINUX_BREAKPAD) 81 #if defined(USE_LINUX_BREAKPAD)
74 metrics->RecordBreakpadRegistration(IsCrashReporterEnabled()); 82 metrics->RecordBreakpadRegistration(IsCrashReporterEnabled());
75 #else 83 #else
76 metrics->RecordBreakpadRegistration(false); 84 metrics->RecordBreakpadRegistration(false);
77 #endif 85 #endif
78 metrics->RecordBreakpadHasDebugger(base::debug::BeingDebugged()); 86 metrics->RecordBreakpadHasDebugger(base::debug::BeingDebugged());
79 } 87 }
80 88
81 void WarnAboutMinimumSystemRequirements() { 89 void WarnAboutMinimumSystemRequirements() {
82 // Nothing to warn about on X11 right now. 90 // Nothing to warn about on X11 right now.
83 } 91 }
84 92
85 // From browser_main_win.h, stubs until we figure out the right thing... 93 // From browser_main_win.h, stubs until we figure out the right thing...
86 94
87 int DoUninstallTasks(bool chrome_still_running) { 95 int DoUninstallTasks(bool chrome_still_running) {
88 return content::RESULT_CODE_NORMAL_EXIT; 96 return content::RESULT_CODE_NORMAL_EXIT;
89 } 97 }
90 98
91 void SetBrowserX11ErrorHandlers() { 99 void SetBrowserX11ErrorHandlers() {
92 // Set up error handlers to make sure profile gets written if X server 100 // Set up error handlers to make sure profile gets written if X server
93 // goes away. 101 // goes away.
94 ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler); 102 ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler);
95 } 103 }
104
105 void UnsetBrowserX11ErrorHandlers() {
106 ui::SetX11ErrorHandlers(X11EmptyErrorHandler, X11EmptyIOErrorHandler);
107 }
OLDNEW
« chrome/browser/chrome_browser_main.cc ('K') | « chrome/browser/chrome_browser_main_x11.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698