From 66ecf81e48e0ba12dc1db3eb286a584ddf157ae7 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 31 Aug 2016 09:46:05 -0700 Subject: [PATCH] =?UTF-8?q?Remove=20support=20for=20the=20=E2=80=94enable-?= =?UTF-8?q?checked-mode=20flag=20from=20the=20engine.=20(flutter/engine#29?= =?UTF-8?q?87)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- engine/src/flutter/common/settings.h | 1 - engine/src/flutter/runtime/dart_init.cc | 12 ++++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/engine/src/flutter/common/settings.h b/engine/src/flutter/common/settings.h index b0c8bc376a..7fe3f9b8bd 100644 --- a/engine/src/flutter/common/settings.h +++ b/engine/src/flutter/common/settings.h @@ -18,7 +18,6 @@ struct Settings { // on the target with the port after it has been selected. uint32_t observatory_port = 0; bool start_paused = false; - bool enable_dart_checked_mode = false; bool trace_startup = false; bool endless_trace_buffer = false; std::string aot_snapshot_path; diff --git a/engine/src/flutter/runtime/dart_init.cc b/engine/src/flutter/runtime/dart_init.cc index a71945a2ce..4542b9cf75 100644 --- a/engine/src/flutter/runtime/dart_init.cc +++ b/engine/src/flutter/runtime/dart_init.cc @@ -522,13 +522,6 @@ void SetRegisterNativeServiceProtocolExtensionHook( g_register_native_service_protocol_extensions_hook = hook; } -static bool ShouldEnableCheckedMode() { - // Checked mode is never enabled during precompilation. Even snapshot - // generation disables checked mode arguments. - return IsRunningPrecompiledCode() ? false - : Settings::Get().enable_dart_checked_mode; -} - void PushBackAll(std::vector* args, const char** argv, size_t argc) { @@ -572,8 +565,11 @@ void InitDartVM() { arraysize(kDartPrecompilationArgs)); } - if (ShouldEnableCheckedMode()) + if (!IsRunningPrecompiledCode()) { + // Enable checked mode if we are not running precompiled code. We run non- + // precompiled code only in the debug product mode. PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs)); + } if (settings.start_paused) PushBackAll(&args, kDartStartPausedArgs, arraysize(kDartStartPausedArgs));