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

Unified Diff: lib/core/options.dart

Issue 11260010: Moved RuntimeOptions from coreimpl to core, renamed to _OptionsImpl. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 months 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 | « no previous file | lib/coreimpl/coreimpl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/core/options.dart
diff --git a/lib/core/options.dart b/lib/core/options.dart
index 0685d176f5b0cc8f5486485ed29863f4ac9254c2..3377c30d2eaf56ca0d53cbd6e31c188615ddadc8 100644
--- a/lib/core/options.dart
+++ b/lib/core/options.dart
@@ -13,7 +13,7 @@ abstract class Options {
* A newly constructed Options object contains the arguments exactly as they
* have been passed to the isolate.
*/
- factory Options() => new RuntimeOptions();
+ factory Options() => new _OptionsImpl();
/**
* Returns a list of arguments that have been passed to this isolate. Any
@@ -42,3 +42,32 @@ abstract class Options {
*/
String get script;
}
+
+class _OptionsImpl implements Options {
+ List<String> get arguments {
+ if (_arguments === null) {
+ // On first access make a copy of the native arguments.
+ _arguments = _nativeArguments.getRange(0, _nativeArguments.length);
+ }
+ return _arguments;
+ }
+
+ String get executable {
+ return _nativeExecutable;
+ }
+
+ String get script {
+ return _nativeScript;
+ }
+
+ List<String> _arguments = null;
+
+ // This arguments singleton is written to by the embedder if applicable.
+ static List<String> _nativeArguments = const [];
+
+ // This executable singleton is written to by the embedder if applicable.
+ static String _nativeExecutable = '';
+
+ // This script singleton is written to by the embedder if applicable.
+ static String _nativeScript = '';
+}
« no previous file with comments | « no previous file | lib/coreimpl/coreimpl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698