mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fix strong flag setting (#4683)
* Turn on strong mode by default when a platform file is present in the bundle instead of using a flag passed into the engine which might not be true when we invoke an installed app. * - Roll dart to version fe96de2858f078e4ad04f8f30640184bf3d8102d * Update license file.
This commit is contained in:
parent
1cab96c6eb
commit
19e8d9b2bf
2
DEPS
2
DEPS
@ -31,7 +31,7 @@ vars = {
|
||||
# Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS.
|
||||
# You can use //tools/dart/create_updated_flutter_deps.py to produce
|
||||
# updated revision list of existing dependencies.
|
||||
'dart_revision': '0fd6aa87a37023d9691cf50866214c1235dab2d1',
|
||||
'dart_revision': 'fe96de2858f078e4ad04f8f30640184bf3d8102d',
|
||||
|
||||
'dart_args_tag': '0.13.7',
|
||||
'dart_async_tag': '2.0.4',
|
||||
|
||||
@ -24,7 +24,6 @@ struct Settings {
|
||||
bool enable_dart_profiling = false;
|
||||
bool use_test_fonts = false;
|
||||
bool dart_non_checked_mode = false;
|
||||
bool dart_strong_mode = false;
|
||||
bool enable_software_rendering = false;
|
||||
bool using_blink = true;
|
||||
std::string aot_shared_library_path;
|
||||
|
||||
@ -599,18 +599,6 @@ void InitDartVM(const uint8_t* vm_snapshot_data,
|
||||
arraysize(kDartWriteProtectCodeArgs));
|
||||
#endif
|
||||
|
||||
if (settings.dart_strong_mode) {
|
||||
// In strong mode we enable all the strong mode options and if running
|
||||
// debug product mode we also enable asserts.
|
||||
PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs));
|
||||
if (use_checked_mode) {
|
||||
PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs));
|
||||
}
|
||||
} else if (use_checked_mode) {
|
||||
PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs));
|
||||
PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs));
|
||||
}
|
||||
|
||||
if (settings.start_paused)
|
||||
PushBackAll(&args, kDartStartPausedArgs, arraysize(kDartStartPausedArgs));
|
||||
|
||||
@ -641,6 +629,24 @@ void InitDartVM(const uint8_t* vm_snapshot_data,
|
||||
FXL_DCHECK(kernel_platform != nullptr);
|
||||
}
|
||||
}
|
||||
if ((kernel_platform != nullptr) ||
|
||||
Dart_IsDart2Snapshot(g_default_isolate_snapshot_data)) {
|
||||
// The presence of the kernel platform file or a snapshot that was generated
|
||||
// for Dart2 indicates we are running in preview-dart-2 mode and in this
|
||||
// mode enable strong mode options by default.
|
||||
// Note: When we start using core snapshots instead of the platform file
|
||||
// in the engine just sniffing the snapshot file should be sufficient.
|
||||
PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs));
|
||||
// In addition if we are running in debug mode we also enable asserts.
|
||||
if (use_checked_mode) {
|
||||
PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs));
|
||||
}
|
||||
} else if (use_checked_mode) {
|
||||
// In non preview-dart-2 mode we enable checked mode and asserts if
|
||||
// we are running in debug mode.
|
||||
PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs));
|
||||
PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs));
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < settings.dart_flags.size(); i++)
|
||||
args.push_back(settings.dart_flags[i].c_str());
|
||||
|
||||
@ -107,10 +107,6 @@ void Shell::InitStandalone(fxl::CommandLine command_line,
|
||||
settings.dart_non_checked_mode =
|
||||
command_line.HasOption(FlagForSwitch(Switch::DartNonCheckedMode));
|
||||
|
||||
// strong mode setting.
|
||||
settings.dart_strong_mode =
|
||||
command_line.HasOption(FlagForSwitch(Switch::DartStrongMode));
|
||||
|
||||
settings.ipv6 = command_line.HasOption(FlagForSwitch(Switch::IPv6));
|
||||
|
||||
settings.start_paused =
|
||||
|
||||
@ -104,7 +104,6 @@ DEF_SWITCH(DartNonCheckedMode,
|
||||
"precompiled and checked mode is unsupported. However, this flag "
|
||||
"may be specified if the user wishes to run in the debug product "
|
||||
"mode (i.e. with JIT or DBC) with checked mode off.")
|
||||
DEF_SWITCH(DartStrongMode, "strong", "Enable Dart 2.0 strong mode.")
|
||||
DEF_SWITCHES_END
|
||||
|
||||
void PrintUsage(const std::string& executable_name);
|
||||
|
||||
@ -301,9 +301,6 @@ public final class FlutterActivityDelegate
|
||||
if (intent.getBooleanExtra("trace-skia", false)) {
|
||||
args.add("--trace-skia");
|
||||
}
|
||||
if (intent.getBooleanExtra("strong", false)) {
|
||||
args.add("--strong");
|
||||
}
|
||||
if (!args.isEmpty()) {
|
||||
String[] argsArray = new String[args.size()];
|
||||
return args.toArray(argsArray);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
Signature: ecc7589805cacc5ca3aab1dad966d380
|
||||
Signature: e5cf14253d584dd35dabad02ec06205b
|
||||
|
||||
UNUSED LICENSES:
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user