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

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

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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 14 matching lines...) Expand all
25 25
26 // Indicates that we're currently responding to an IO error (by shutting down). 26 // Indicates that we're currently responding to an IO error (by shutting down).
27 bool g_in_x11_io_error_handler = false; 27 bool g_in_x11_io_error_handler = false;
28 28
29 // Number of seconds to wait for UI thread to get an IO error if we get it on 29 // Number of seconds to wait for UI thread to get an IO error if we get it on
30 // the background thread. 30 // the background thread.
31 const int kWaitForUIThreadSeconds = 10; 31 const int kWaitForUIThreadSeconds = 10;
32 32
33 int BrowserX11ErrorHandler(Display* d, XErrorEvent* error) { 33 int BrowserX11ErrorHandler(Display* d, XErrorEvent* error) {
34 if (!g_in_x11_io_error_handler) 34 if (!g_in_x11_io_error_handler)
35 MessageLoop::current()->PostTask( 35 base::MessageLoop::current()->PostTask(
36 FROM_HERE, 36 FROM_HERE,
37 base::Bind(&ui::LogErrorEventDescription, d, *error)); 37 base::Bind(&ui::LogErrorEventDescription, d, *error));
38 return 0; 38 return 0;
39 } 39 }
40 40
41 41
42 // This function is used to help us diagnose crash dumps that happen 42 // This function is used to help us diagnose crash dumps that happen
43 // during the shutdown process. 43 // during the shutdown process.
44 NOINLINE void WaitingForUIThreadToHandleIOError() { 44 NOINLINE void WaitingForUIThreadToHandleIOError() {
45 // Ensure function isn't optimized away. 45 // Ensure function isn't optimized away.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 void SetBrowserX11ErrorHandlers() { 99 void SetBrowserX11ErrorHandlers() {
100 // 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
101 // goes away. 101 // goes away.
102 ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler); 102 ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler);
103 } 103 }
104 104
105 void UnsetBrowserX11ErrorHandlers() { 105 void UnsetBrowserX11ErrorHandlers() {
106 ui::SetX11ErrorHandlers(X11EmptyErrorHandler, X11EmptyIOErrorHandler); 106 ui::SetX11ErrorHandlers(X11EmptyErrorHandler, X11EmptyIOErrorHandler);
107 } 107 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main_android.cc ('k') | chrome/browser/chromeos/app_mode/kiosk_app_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698