Skip to content

Commit

Permalink
some work towards a --start-paused flag
Browse files Browse the repository at this point in the history
  • Loading branch information
devoncarew committed Feb 2, 2016
1 parent 1914139 commit 3c83f89
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 3 deletions.
7 changes: 7 additions & 0 deletions sky/engine/core/script/dart_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ static const char* kDartCheckedModeArgs[] = {
"--error_on_bad_override",
};

static const char* kDartStartPausedArgs[]{
"--pause_isolates_on_start",
};

void IsolateShutdownCallback(void* callback_data) {
// TODO(dart)
}
Expand Down Expand Up @@ -295,6 +299,9 @@ void InitDartVM() {
if (enable_checked_mode)
args.append(kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs));

if (SkySettings::Get().start_paused)
args.append(kDartStartPausedArgs, arraysize(kDartStartPausedArgs));

CHECK(Dart_SetVMFlags(args.size(), args.data()));

{
Expand Down
1 change: 1 addition & 0 deletions sky/engine/public/platform/sky_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace blink {

struct SkySettings {
bool enable_observatory = false;
bool start_paused = false;
bool enable_dart_checked_mode = false;

static const SkySettings& Get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ private String[] getArgsFromIntent(Intent intent) {
if (intent.getBooleanExtra("trace-startup", false)) {
args.add("--trace-startup");
}
if (intent.getBooleanExtra("start-paused", false)) {
args.add("--start-paused");
}
if (!args.isEmpty()) {
String[] argsArray = new String[args.size()];
return args.toArray(argsArray);
Expand Down
1 change: 1 addition & 0 deletions sky/shell/shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ void Shell::InitStandalone() {
blink::SkySettings settings;
settings.enable_observatory =
!command_line.HasSwitch(switches::kNonInteractive);
settings.start_paused = command_line.HasSwitch(switches::kStartPaused);
settings.enable_dart_checked_mode =
command_line.HasSwitch(switches::kEnableCheckedMode);
blink::SkySettings::Set(settings);
Expand Down
2 changes: 2 additions & 0 deletions sky/shell/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ const char kFLX[] = "flx";
const char kHelp[] = "help";
const char kNonInteractive[] = "non-interactive";
const char kPackageRoot[] = "package-root";
const char kStartPaused[] = "start-paused";
const char kTraceStartup[] = "trace-startup";

void PrintUsage(const std::string& executable_name) {
std::cerr << "Usage: " << executable_name
<< " --" << kEnableCheckedMode
<< " --" << kNonInteractive
<< " --" << kStartPaused
<< " --" << kTraceStartup
<< " --" << kFLX << "=FLX"
<< " --" << kPackageRoot << "=PACKAGE_ROOT"
Expand Down
1 change: 1 addition & 0 deletions sky/shell/switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ extern const char kFLX[];
extern const char kHelp[];
extern const char kNonInteractive[];
extern const char kPackageRoot[];
extern const char kStartPaused[];
extern const char kTraceStartup[];

void PrintUsage(const std::string& executable_name);
Expand Down
5 changes: 2 additions & 3 deletions sky/shell/tracing_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static const char* ObservatoryInvoke(const char* method,
intptr_t num_params,
void* user_data) {
if (user_data == nullptr) {
// During the desctruction on the tracing controller, the user data is
// During the destruction of the tracing controller, the user data is
// cleared. Make sure that observatory requests to service calls are not
// attempted after tracing controller destruction.
return strdup(kObservatoryResultFail);
Expand All @@ -54,8 +54,7 @@ static const char* ObservatoryInvoke(const char* method,
// Flushing the trace log requires an active message loop. However,
// observatory callbacks are made on a dart worker thread. We setup a
// message loop manually and tell the flush completion handler to
// terminate
// the loop when done
// terminate the loop when done
base::MessageLoop worker_thread_loop;

base::FilePath temp_dir;
Expand Down

0 comments on commit 3c83f89

Please sign in to comment.