Comment on attachment 578249
gsettings proxy patch v3
>+ nsCOMPtr<nsIGSettingsCollection> proxy_settings;
>+
>+ // Check if proxy is enabled, flag is only in schema org.gnome.system.proxy.http,
>+ // there is no separate flag for each schema.
>+ nsresult rv = mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy.http"),
>+ getter_AddRefs(proxy_settings));
>+ NS_ENSURE_SUCCESS(rv, rv);
>+
>+ rv = mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy"),
>+ getter_AddRefs(proxy_settings));
The "org.gnome.system.proxy.http" schema is now not needed here.
>- if (!mGConf)
>+ if (!mGConf || !mGSettings)
> return GetProxyFromEnvironment(scheme, host, port, aResult);
This isn't what we want. This will use the environment unless GSettings and
GConf are available. Best to treat this as a fallback after the GSettings and
GConf code.
>+ /* Check for org.gnome.syste.proxy schema */
>+ nsCOMPtr<nsIGSettingsCollection> proxy_settings;
>+ mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy"),
>+ getter_AddRefs(proxy_settings));
>+ /* If schema is found let GSettings determine the right proxy, otherwise fallback to gconf. */
>+ if (proxy_settings)
>+ return GetProxyFromGSettings(scheme, host, port, aResult);
GetCollectionForSchema is an expensive operation, so I don't want the
"org.gnome.system.proxy" schema fetched both here and in GetProxyFromGSettings.
I think it should be fine to fall back to GConf and/or environment variables
when GetProxyFromGSettings returns a failure code.
Comment on attachment 578249
gsettings proxy patch v3
>+ nsCOMPtr< nsIGSettingsCol lection> proxy_settings; system. proxy.http, >GetCollectionF orSchema( NS_LITERAL_ CSTRING( "org.gnome. system. proxy.http" ), AddRefs( proxy_settings) ); SUCCESS( rv, rv); >GetCollectionF orSchema( NS_LITERAL_ CSTRING( "org.gnome. system. proxy") , AddRefs( proxy_settings) );
>+
>+ // Check if proxy is enabled, flag is only in schema org.gnome.
>+ // there is no separate flag for each schema.
>+ nsresult rv = mGSettings-
>+ getter_
>+ NS_ENSURE_
>+
>+ rv = mGSettings-
>+ getter_
The "org.gnome. system. proxy.http" schema is now not needed here.
>- if (!mGConf) ironment( scheme, host, port, aResult);
>+ if (!mGConf || !mGSettings)
> return GetProxyFromEnv
This isn't what we want. This will use the environment unless GSettings and
GConf are available. Best to treat this as a fallback after the GSettings and
GConf code.
>+ /* Check for org.gnome. syste.proxy schema */ nsIGSettingsCol lection> proxy_settings; >GetCollectionF orSchema( NS_LITERAL_ CSTRING( "org.gnome. system. proxy") , AddRefs( proxy_settings) ); ttings( scheme, host, port, aResult);
>+ nsCOMPtr<
>+ mGSettings-
>+ getter_
>+ /* If schema is found let GSettings determine the right proxy, otherwise fallback to gconf. */
>+ if (proxy_settings)
>+ return GetProxyFromGSe
GetCollectionFo rSchema is an expensive operation, so I don't want the system. proxy" schema fetched both here and in GetProxyFromGSe ttings.
"org.gnome.
I think it should be fine to fall back to GConf and/or environment variables ttings returns a failure code.
when GetProxyFromGSe