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

Unified Diff: chrome/browser/chrome_browser_main_extra_parts_x11.cc

Issue 1996413002: mash: Fix a mash_browser_tests crash on x11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main_extra_parts_x11.cc
diff --git a/chrome/browser/chrome_browser_main_extra_parts_x11.cc b/chrome/browser/chrome_browser_main_extra_parts_x11.cc
index 13ff1f0fc7cf48b629271d0727270547b4f28d6d..e15ee65da08258dafdb6c932e24ab1954b43d23a 100644
--- a/chrome/browser/chrome_browser_main_extra_parts_x11.cc
+++ b/chrome/browser/chrome_browser_main_extra_parts_x11.cc
@@ -99,14 +99,18 @@ void ChromeBrowserMainExtraPartsX11::PostMainMessageLoopStart() {
ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler);
#if !defined(OS_CHROMEOS)
- // Get a timestamp from the X server. This makes our requests to the server
- // less likely to be thrown away by the window manager. Put the timestamp in
- // a command line flag so we can forward it to an existing browser process if
- // necessary.
- base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kWmUserTimeMs,
- base::Uint64ToString(
- ui::X11EventSource::GetInstance()->UpdateLastSeenServerTime()));
+ // It is possible for X11EventSource to not have been created (e.g. when
+ // running as a mus client).
+ if (ui::X11EventSource::GetInstance()) {
+ // Get a timestamp from the X server. This makes our requests to the server
+ // less likely to be thrown away by the window manager. Put the timestamp
+ // in a command line flag so we can forward it to an existing browser
+ // process if necessary.
+ base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ switches::kWmUserTimeMs,
+ base::Uint64ToString(
+ ui::X11EventSource::GetInstance()->UpdateLastSeenServerTime()));
+ }
#endif
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698