diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index e747db6a8b7b..4b31983322c9 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -105,6 +105,9 @@ let patches = [ ./patches/nix_plugin_paths_52.patch + # To enable ChromeCast, go to chrome://flags and set "Load Media Router Component Extension" to Enabled + # Fixes Chromecast: https://bugs.chromium.org/p/chromium/issues/detail?id=734325 + ./patches/fix_network_api_crash.patch ] ++ optional (versionOlder version "57.0") ./patches/glibc-2.24.patch ++ optional enableWideVine ./patches/widevine.patch; diff --git a/pkgs/applications/networking/browsers/chromium/patches/fix_network_api_crash.patch b/pkgs/applications/networking/browsers/chromium/patches/fix_network_api_crash.patch new file mode 100644 index 000000000000..093598465c47 --- /dev/null +++ b/pkgs/applications/networking/browsers/chromium/patches/fix_network_api_crash.patch @@ -0,0 +1,77 @@ +Index: extensions/browser/api/networking_private/networking_private_linux.cc +=================================================================== +--- a/extensions/browser/api/networking_private/networking_private_linux.cc.orig 2016-05-05 03:01:50.000000000 +0200 ++++ b/extensions/browser/api/networking_private/networking_private_linux.cc 2016-05-10 16:16:42.431052917 +0200 +@@ -215,12 +215,14 @@ void NetworkingPrivateLinux::GetState( + std::unique_ptr network_properties( + new base::DictionaryValue); + ++ std::string* erp = error.get(); ++ base::DictionaryValue* npp = network_properties.get(); + // Runs GetCachedNetworkProperties on |dbus_thread|. + dbus_thread_.task_runner()->PostTaskAndReply( + FROM_HERE, base::Bind(&NetworkingPrivateLinux::GetCachedNetworkProperties, + base::Unretained(this), guid, +- base::Unretained(network_properties.get()), +- base::Unretained(error.get())), ++ base::Unretained(npp), ++ base::Unretained(erp)), + base::Bind(&GetCachedNetworkPropertiesCallback, base::Passed(&error), + base::Passed(&network_properties), success_callback, + failure_callback)); +@@ -301,11 +303,12 @@ void NetworkingPrivateLinux::GetNetworks + + // Runs GetAllWiFiAccessPoints on the dbus_thread and returns the + // results back to OnAccessPointsFound where the callback is fired. ++ NetworkMap* nmp = network_map.get(); + dbus_thread_.task_runner()->PostTaskAndReply( + FROM_HERE, + base::Bind(&NetworkingPrivateLinux::GetAllWiFiAccessPoints, + base::Unretained(this), configured_only, visible_only, limit, +- base::Unretained(network_map.get())), ++ base::Unretained(nmp)), + base::Bind(&NetworkingPrivateLinux::OnAccessPointsFound, + base::Unretained(this), base::Passed(&network_map), + success_callback, failure_callback)); +@@ -321,11 +324,12 @@ bool NetworkingPrivateLinux::GetNetworks + // Runs GetAllWiFiAccessPoints on the dbus_thread and returns the + // results back to SendNetworkListChangedEvent to fire the event. No + // callbacks are used in this case. ++ NetworkMap* nmp = network_map.get(); + dbus_thread_.task_runner()->PostTaskAndReply( + FROM_HERE, base::Bind(&NetworkingPrivateLinux::GetAllWiFiAccessPoints, + base::Unretained(this), false /* configured_only */, + false /* visible_only */, 0 /* limit */, +- base::Unretained(network_map.get())), ++ base::Unretained(nmp)), + base::Bind(&NetworkingPrivateLinux::OnAccessPointsFoundViaScan, + base::Unretained(this), base::Passed(&network_map))); + +@@ -506,11 +510,12 @@ void NetworkingPrivateLinux::StartConnec + + std::unique_ptr error(new std::string); + ++ std::string* erp = error.get(); + // Runs ConnectToNetwork on |dbus_thread|. + dbus_thread_.task_runner()->PostTaskAndReply( + FROM_HERE, + base::Bind(&NetworkingPrivateLinux::ConnectToNetwork, +- base::Unretained(this), guid, base::Unretained(error.get())), ++ base::Unretained(this), guid, base::Unretained(erp)), + base::Bind(&OnNetworkConnectOperationCompleted, base::Passed(&error), + success_callback, failure_callback)); + } +@@ -524,11 +529,12 @@ void NetworkingPrivateLinux::StartDiscon + + std::unique_ptr error(new std::string); + ++ std::string* erp = error.get(); + // Runs DisconnectFromNetwork on |dbus_thread|. + dbus_thread_.task_runner()->PostTaskAndReply( + FROM_HERE, + base::Bind(&NetworkingPrivateLinux::DisconnectFromNetwork, +- base::Unretained(this), guid, base::Unretained(error.get())), ++ base::Unretained(this), guid, base::Unretained(erp)), + base::Bind(&OnNetworkConnectOperationCompleted, base::Passed(&error), + success_callback, failure_callback)); + }