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

Unified Diff: content/browser/browser_main_loop.cc

Issue 250723002: content: Terminate early if the toolkit initialization fails. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 8 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 | « content/browser/browser_main_loop.h ('k') | content/browser/browser_main_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 015317996270e81c314c9731b00f44d4c33f1059..3478844b7082267ef56b100bca7fc3c69eac8b1d 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -115,6 +115,7 @@
#if defined(USE_X11)
#include "ui/gfx/x/x11_connection.h"
+#include "ui/gfx/x/x11_types.h"
#endif
#if defined(USE_OZONE)
@@ -1023,7 +1024,7 @@ int BrowserMainLoop::BrowserThreadsStarted() {
return result_code_;
}
-void BrowserMainLoop::InitializeToolkit() {
+bool BrowserMainLoop::InitializeToolkit() {
TRACE_EVENT0("startup", "BrowserMainLoop::InitializeToolkit")
// TODO(evan): this function is rather subtle, due to the variety
// of intersecting ifdefs we have. To keep it easy to follow, there
@@ -1048,13 +1049,21 @@ void BrowserMainLoop::InitializeToolkit() {
#endif
#if defined(USE_AURA)
+
+#if defined(USE_X11)
+ if (!gfx::GetXDisplay())
+ return false;
+#endif
+
// Env creates the compositor. Aura widgets need the compositor to be created
// before they can be initialized by the browser.
aura::Env::CreateInstance();
-#endif
+#endif // defined(USE_AURA)
if (parts_)
parts_->ToolkitInitialized();
+
+ return true;
}
void BrowserMainLoop::MainMessageLoopRun() {
« no previous file with comments | « content/browser/browser_main_loop.h ('k') | content/browser/browser_main_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698