-
Notifications
You must be signed in to change notification settings - Fork 16.2k
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
Conversation
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
Needed for using e.g. `switches::kEnableFeatures` in electron/electron#13784.
fa1bbd2
to
e565142
Compare
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`.
e565142
to
39ff510
Compare
We have automatically backported this PR to "3-0-x", please check out #13805 |
Unlike Chrome, we were not using the --enable-features and
--disable-features command-line arguments to initialize
base::FeatureList
.