Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Add support for setting allow http flag in Dart VM #17653

Merged
merged 4 commits into from
Apr 11, 2020
Merged

Add support for setting allow http flag in Dart VM #17653

merged 4 commits into from
Apr 11, 2020

Conversation

mehmetf
Copy link
Contributor

@mehmetf mehmetf commented Apr 11, 2020

This is not a breaking change. It simply allows embedding code to set disable_http setting. Related to flutter/flutter#54448.

@mehmetf mehmetf requested a review from jason-simmons April 11, 2020 05:28
@auto-assign auto-assign bot requested a review from chinmaygarde April 11, 2020 05:28
Comment on lines +25 to +27
// The SDK expects this field to represent "allow http" so we switch the
// value.
Dart_Handle allow_http_value = disable_http ? Dart_False() : Dart_True();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the SDK uses "allow", why use "disable" here? The inconsistency (especially in C++ where there are not named parameters) increases the likelihood for a potential mismatch.

(The style guide for the flutter/flutter repo discourages negative names. Granted, that's not a style guide for flutter/engine, but I think it's still a good convention to follow.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I struggled with this too. The problem is that boolean switches in engine currently don't test for values. They simply infer true if the switch exists and false if it does not. This works well only for settings whose default value is false.

I would ideally have a switch for allow_http and then be able to do --noallow_http from the embedder. My understanding is that that would require a large-ish change to the switch processing (and it is only relevant for Android). I figured it is not worth doing especially with many examples of negative names in engine already.

Another simple way to solve this is to have an explicit switch for --noallow_http. But that doesn't really solve the problem. You still end up with a negative name and the negation is pushed to somewhere else.

@mehmetf mehmetf added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Apr 11, 2020
@fluttergithubbot fluttergithubbot merged commit 47a88e8 into flutter:master Apr 11, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 11, 2020
goderbauer pushed a commit to goderbauer/engine that referenced this pull request Apr 16, 2020
@mehmetf mehmetf deleted the ban_http branch May 19, 2020 23:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants