Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #library("drt_updater"); | 5 #library("drt_updater"); |
| 6 | 6 |
| 7 #import("dart:io"); | 7 #import("dart:io"); |
| 8 #import("dart:builtin"); | 8 #import("dart:builtin"); |
| 9 | 9 |
| 10 class _DartiumUpdater { | 10 class _DartiumUpdater { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 | 46 |
| 47 void _onUpdatedHandler(int exit_code) { | 47 void _onUpdatedHandler(int exit_code) { |
| 48 print('$name updated ($exit_code)'); | 48 print('$name updated ($exit_code)'); |
| 49 for (var callback in onUpdated ) callback(); | 49 for (var callback in onUpdated ) callback(); |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 _DartiumUpdater _dumpRenderTreeUpdater; | 53 _DartiumUpdater _dumpRenderTreeUpdater; |
| 54 _DartiumUpdater _dartiumUpdater; | 54 _DartiumUpdater _dartiumUpdater; |
| 55 | 55 |
| 56 _DartiumUpdater runtimeUpdater(String runtime) { | 56 _DartiumUpdater runtimeUpdater(Map configuration) { |
| 57 if (runtime == 'drt') { | 57 String runtime = configuration['runtime']; |
| 58 if (!configuration.containsKey(runtime) || configuration[runtime] != '') { | |
|
Bill Hesse
2012/04/30 13:46:10
This seems totally wrong. I think configuration['
vsm
2012/04/30 14:00:33
I'm checking what you suggest. It's runtime the v
Bill Hesse
2012/05/01 08:03:33
Oh, I see. That is really tricky, and easy to ove
| |
| 59 // Either the runtime executable does not require updating or an | |
| 60 // explicit path is provided via --drt or --dartium. | |
| 61 return null; | |
| 62 } else if (runtime == 'drt') { | |
| 58 if (_dumpRenderTreeUpdater === null) { | 63 if (_dumpRenderTreeUpdater === null) { |
| 59 _dumpRenderTreeUpdater = new _DartiumUpdater('DumpRenderTree', | 64 _dumpRenderTreeUpdater = new _DartiumUpdater('DumpRenderTree', |
| 60 'get_drt.py'); | 65 'get_drt.py'); |
| 61 } | 66 } |
| 62 return _dumpRenderTreeUpdater; | 67 return _dumpRenderTreeUpdater; |
| 63 } else if (runtime == 'dartium') { | 68 } else if (runtime == 'dartium') { |
| 64 if (_dartiumUpdater === null) { | 69 if (_dartiumUpdater === null) { |
| 65 _dartiumUpdater = new _DartiumUpdater('Dartium Chrome', 'get_drt.py', | 70 _dartiumUpdater = new _DartiumUpdater('Dartium Chrome', 'get_drt.py', |
| 66 '--dartium'); | 71 '--dartium'); |
| 67 } | 72 } |
| 68 return _dartiumUpdater; | 73 return _dartiumUpdater; |
| 69 } else { | 74 } else { |
| 70 return null; | 75 return null; |
| 71 } | 76 } |
| 72 } | 77 } |
| OLD | NEW |