Chromium Code Reviews| Index: services/service_manager/embedder/main.cc |
| diff --git a/services/service_manager/embedder/main.cc b/services/service_manager/embedder/main.cc |
| index 9635dc2c514bdd43a2ca02535d06d901dfe11f31..77f4eb3eaa71e9d2ed3e0604570fb13896a8c071 100644 |
| --- a/services/service_manager/embedder/main.cc |
| +++ b/services/service_manager/embedder/main.cc |
| @@ -338,6 +338,19 @@ int Main(const MainParams& params) { |
| #endif |
| base::EnableTerminationOnOutOfMemory(); |
| +#if defined(OS_LINUX) |
| + // The various desktop environments set this environment variable that allows |
| + // the dbus client library to connect directly to the bus. When this variable |
| + // is not set (test environments like xvfb-run), the dbus client library will |
| + // fall back to auto-launch mode. Auto-launch is dangerous as it can cause |
| + // hangs (crbug.com/715658) . This one line disables the dbus auto-launch, |
| + // by clobbering the DBUS_SESSION_BUS_ADDRESS env variable if not already set. |
| + // The old auto-launch behavior, if needed, can be restored by setting |
| + // DBUS_SESSION_BUS_ADDRESS="autolaunch:" before launching chrome. |
| + const int kNoOverrideIfAlreadySet = 0; |
| + setenv("DBUS_SESSION_BUS_ADDRESS", "disabled:", kNoOverrideIfAlreadySet); |
|
satorux1
2017/05/08 01:30:37
Several environmental variables, such as GNOME_DIS
|
| +#endif |
| + |
| #if defined(OS_WIN) |
| base::win::RegisterInvalidParamHandler(); |
| ui::win::CreateATLModuleIfNeeded(); |