8000 fix: Use --enable-features and --disable-features by poiru · Pull Request #13784 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: Use --enable-features and --disable-features #13784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2018

Conversation

poiru
Copy link
Contributor
@poiru poiru commented Jul 24, 2018

Unlike Chrome, we were not using the --enable-features and
--disable-features command-line arguments to initialize
base::FeatureList.

Copy link
Member
@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

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

LGTM, with minor changes.

// would initialize the first FeatureList instance, but cannot do this any
// earlier because we want to give the user JS script a chance to alter
// command-line switches.
base::FeatureList::ClearInstanceForTesting();
Copy link
Member

Choose a reason for hiding this comment

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

We can override BrowserMainParts::ShouldContentCreateFeatureList to signal that we handle feature list creation. Its better to avoid using internal testing apis.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, but we still need to use ClearInstanceForTesting() unfortunately. See updated comments.

// switches::k{Enable,Disable}Features instead.
const auto enable_features =
command_line->GetSwitchValueASCII("enable-features");
auto disable_features = command_line->GetSwitchValueASCII("disable-features");
Copy link
Member

Choose a reason for hiding this comment

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

Can you ship and link base_static from libcc for linux and macOS to fix this, we already build it.

Copy link
Contributor Author
@poiru poiru Jul 24, 2018

Choose a reason for hiding this comment

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

Opened the libcc PR. Will fix after that's merged. Done!

disable_features +=
",GuestViewCrossProcessFrames,SurfaceSynchronization,AsyncWheelEvents";

std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
Copy link
Contributor

Choose a reason for hiding this comment

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

use auto feature_list = std::make_unique<base::FeatureList>(); instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

poiru added a commit to electron/libchromiumcontent that referenced this pull request Jul 24, 2018
Needed for using e.g. `switches::kEnableFeatures` in
electron/electron#13784.
@poiru poiru force-pushed the fix-enable-disable-features branch 2 times, most recently from fa1bbd2 to e565142 Compare July 24, 2018 15:13
MarshallOfSound pushed a commit to electron/libchromiumcontent that referenced this pull request Jul 24, 2018
Needed for using e.g. `switches::kEnableFeatures` in
electron/electron#13784.
Unlike Chrome, we were not using the --enable-features and
--disable-features command-line arguments to initialize
`base::FeatureList`.
@poiru poiru force-pushed the fix-enable-disable-features branch from e565142 to 39ff510 Compare July 25, 2018 17:07
@zeke zeke merged commit 9220ca2 into master Jul 25, 2018
@trop
Copy link
Contributor
trop bot commented Jul 25, 2018

We have automatically backported this PR to "3-0-x", please check out #13805

@poiru poiru deleted the fix-enable-disable-features branch July 25, 2018 18:11
@trop trop bot added merged/3-0-x and removed target/3-0-x labels Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0