| 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 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 } | 605 } |
| 606 | 606 |
| 607 // Start a handle watcher. | 607 // Start a handle watcher. |
| 608 handle_watcher_producer_handle_ = HandleWatcher::Start(); | 608 handle_watcher_producer_handle_ = HandleWatcher::Start(); |
| 609 | 609 |
| 610 std::vector<const char*> flags; | 610 std::vector<const char*> flags; |
| 611 // Disable access dart:mirrors library. | 611 // Disable access dart:mirrors library. |
| 612 flags.push_back("--enable_mirrors=false"); | 612 flags.push_back("--enable_mirrors=false"); |
| 613 // Force await and async to be keywords even outside of an async function. | 613 // Force await and async to be keywords even outside of an async function. |
| 614 flags.push_back("--await_is_keyword"); | 614 flags.push_back("--await_is_keyword"); |
| 615 // Enable background compilation |
| 616 flags.push_back("--background_compilation=true"); |
| 617 // Disable code write protection |
| 618 // TODO(johnmccutchan): This might be a security issue once Mojo gets a |
| 619 // security sandbox. Revisit when that happens. |
| 620 flags.push_back("--write_protect_code=false"); |
| 615 // Add remaining flags. | 621 // Add remaining flags. |
| 616 for (int i = 0; i < vm_flags_count; ++i) { | 622 for (int i = 0; i < vm_flags_count; ++i) { |
| 617 flags.push_back(vm_flags[i]); | 623 flags.push_back(vm_flags[i]); |
| 618 } | 624 } |
| 619 | 625 |
| 620 tonic::DartVM::Config config; | 626 tonic::DartVM::Config config; |
| 621 config.vm_isolate_snapshot = vm_isolate_snapshot_buffer; | 627 config.vm_isolate_snapshot = vm_isolate_snapshot_buffer; |
| 622 config.create = IsolateCreateCallback; | 628 config.create = IsolateCreateCallback; |
| 623 config.shutdown = IsolateShutdownCallback; | 629 config.shutdown = IsolateShutdownCallback; |
| 624 config.entropy_source = entropy; | 630 config.entropy_source = entropy; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 } | 720 } |
| 715 BlockForServiceIsolateLocked(); | 721 BlockForServiceIsolateLocked(); |
| 716 HandleWatcher::StopAll(); | 722 HandleWatcher::StopAll(); |
| 717 CHECK(tonic::DartVM::Cleanup()); | 723 CHECK(tonic::DartVM::Cleanup()); |
| 718 service_isolate_running_ = false; | 724 service_isolate_running_ = false; |
| 719 initialized_ = false; | 725 initialized_ = false; |
| 720 } | 726 } |
| 721 | 727 |
| 722 } // namespace apps | 728 } // namespace apps |
| 723 } // namespace mojo | 729 } // namespace mojo |
| OLD | NEW |