Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(987)

Unified Diff: mojo/dart/embedder/dart_controller.cc

Issue 1480243004: Dart: Lazy observatory asset loading. Option to disable the observatory. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/dart/embedder/dart_controller.h ('k') | mojo/dart/embedder/vmservice/main.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/embedder/dart_controller.cc
diff --git a/mojo/dart/embedder/dart_controller.cc b/mojo/dart/embedder/dart_controller.cc
index f084120e93ed8d0d3c63a44485e0c8de848046eb..0b38ef3495d7353bde42d4a808aca5c9f3f7a2cb 100644
--- a/mojo/dart/embedder/dart_controller.cc
+++ b/mojo/dart/embedder/dart_controller.cc
@@ -352,7 +352,8 @@ Dart_Isolate DartController::CreateIsolateHelper(
// The VM is creating the service isolate.
if (Dart_IsServiceIsolate(isolate)) {
service_isolate_spawned_ = true;
- const intptr_t port = SupportDartMojoIo() ? 0 : -1;
+ const intptr_t port =
+ (SupportDartMojoIo() && observatory_enabled_) ? 0 : -1;
InitializeDartMojoIo();
if (!VmService::Setup("127.0.0.1", port)) {
*error = strdup(VmService::GetErrorMessage());
@@ -504,6 +505,7 @@ MojoHandle DartController::handle_watcher_producer_handle_ =
bool DartController::service_isolate_running_ = false;
bool DartController::service_isolate_spawned_ = false;
bool DartController::strict_compilation_ = false;
+bool DartController::observatory_enabled_ = true;
DartControllerServiceConnector* DartController::service_connector_ = nullptr;
base::Lock DartController::lock_;
@@ -709,9 +711,11 @@ static bool generateEntropy(uint8_t* buffer, intptr_t length) {
bool DartController::Initialize(
DartControllerServiceConnector* service_connector,
bool strict_compilation,
+ bool observatory_enabled,
const char** extra_args,
int extra_args_count) {
service_connector_ = service_connector;
+ observatory_enabled_ = observatory_enabled;
strict_compilation_ = strict_compilation;
InitVmIfNeeded(generateEntropy, extra_args, extra_args_count);
return true;
« no previous file with comments | « mojo/dart/embedder/dart_controller.h ('k') | mojo/dart/embedder/vmservice/main.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698