| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MOJO_DART_EMBEDDER_DART_CONTROLLER_H_ | 5 #ifndef MOJO_DART_EMBEDDER_DART_CONTROLLER_H_ |
| 6 #define MOJO_DART_EMBEDDER_DART_CONTROLLER_H_ | 6 #define MOJO_DART_EMBEDDER_DART_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <unordered_set> | 8 #include <unordered_set> |
| 9 | 9 |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // config.script to completion. This function returns when the script exits | 100 // config.script to completion. This function returns when the script exits |
| 101 // and the handle watcher is shutdown. If you need to run multiple Dart | 101 // and the handle watcher is shutdown. If you need to run multiple Dart |
| 102 // scripts in the same VM, use the calls below. | 102 // scripts in the same VM, use the calls below. |
| 103 static bool RunSingleDartScript(const DartControllerConfig& config); | 103 static bool RunSingleDartScript(const DartControllerConfig& config); |
| 104 | 104 |
| 105 // Initializes the Dart VM, and starts up Dart's handle watcher. | 105 // Initializes the Dart VM, and starts up Dart's handle watcher. |
| 106 // If strict_compilation is true, the VM runs scripts with assertions and | 106 // If strict_compilation is true, the VM runs scripts with assertions and |
| 107 // type checking enabled. | 107 // type checking enabled. |
| 108 static bool Initialize(DartControllerServiceConnector* service_connector, | 108 static bool Initialize(DartControllerServiceConnector* service_connector, |
| 109 bool strict_compilation, | 109 bool strict_compilation, |
| 110 bool observatory_enabled, |
| 110 const char** extra_args, | 111 const char** extra_args, |
| 111 int extra_args_count); | 112 int extra_args_count); |
| 112 | 113 |
| 113 // Assumes Initialize has been called. Runs the main function using the | 114 // Assumes Initialize has been called. Runs the main function using the |
| 114 // script, arguments, and package_root given by 'config'. | 115 // script, arguments, and package_root given by 'config'. |
| 115 static bool RunDartScript(const DartControllerConfig& config); | 116 static bool RunDartScript(const DartControllerConfig& config); |
| 116 | 117 |
| 117 // Waits for the handle watcher isolate to finish and shuts down the VM. | 118 // Waits for the handle watcher isolate to finish and shuts down the VM. |
| 118 static void Shutdown(); | 119 static void Shutdown(); |
| 119 | 120 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 static void BlockForServiceIsolate(); | 160 static void BlockForServiceIsolate(); |
| 160 static void BlockForServiceIsolateLocked(); | 161 static void BlockForServiceIsolateLocked(); |
| 161 | 162 |
| 162 static void LoadEmptyScript(const std::string& script_uri); | 163 static void LoadEmptyScript(const std::string& script_uri); |
| 163 | 164 |
| 164 static tonic::DartLibraryProvider* library_provider_; | 165 static tonic::DartLibraryProvider* library_provider_; |
| 165 static base::Lock lock_; | 166 static base::Lock lock_; |
| 166 static MojoHandle handle_watcher_producer_handle_; | 167 static MojoHandle handle_watcher_producer_handle_; |
| 167 static bool initialized_; | 168 static bool initialized_; |
| 168 static bool strict_compilation_; | 169 static bool strict_compilation_; |
| 170 static bool observatory_enabled_; |
| 169 static bool service_isolate_running_; | 171 static bool service_isolate_running_; |
| 170 static bool service_isolate_spawned_; | 172 static bool service_isolate_spawned_; |
| 171 static DartControllerServiceConnector* service_connector_; | 173 static DartControllerServiceConnector* service_connector_; |
| 172 }; | 174 }; |
| 173 | 175 |
| 174 } // namespace dart | 176 } // namespace dart |
| 175 } // namespace mojo | 177 } // namespace mojo |
| 176 | 178 |
| 177 #endif // MOJO_DART_EMBEDDER_DART_CONTROLLER_H_ | 179 #endif // MOJO_DART_EMBEDDER_DART_CONTROLLER_H_ |
| OLD | NEW |