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

Side by Side Diff: sky/tools/packager/vm.cc

Issue 1233463002: Ban dart:mirrors in Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « sky/sdk/lib/widgets/tabs.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "sky/tools/packager/vm.h" 5 #include "sky/tools/packager/vm.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "sky/tools/packager/loader.h" 8 #include "sky/tools/packager/loader.h"
9 #include "sky/tools/packager/logging.h" 9 #include "sky/tools/packager/logging.h"
10 10
11 namespace blink { 11 namespace blink {
12 extern const uint8_t* kDartVmIsolateSnapshotBuffer; 12 extern const uint8_t* kDartVmIsolateSnapshotBuffer;
13 extern const uint8_t* kDartIsolateSnapshotBuffer; 13 extern const uint8_t* kDartIsolateSnapshotBuffer;
14 } 14 }
15 15
16 static const char* kDartArgs[] = {
17 "--enable_mirrors=false",
18 };
19
16 void InitDartVM() { 20 void InitDartVM() {
17 int argc = 0; 21 CHECK(Dart_SetVMFlags(arraysize(kDartArgs), kDartArgs));
18 const char** argv = nullptr;
19
20 CHECK(Dart_SetVMFlags(argc, argv));
21 CHECK(Dart_Initialize(blink::kDartVmIsolateSnapshotBuffer, nullptr, nullptr, 22 CHECK(Dart_Initialize(blink::kDartVmIsolateSnapshotBuffer, nullptr, nullptr,
22 nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 23 nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
23 nullptr)); 24 nullptr));
24 } 25 }
25 26
26 Dart_Isolate CreateDartIsolate() { 27 Dart_Isolate CreateDartIsolate() {
27 CHECK(blink::kDartIsolateSnapshotBuffer); 28 CHECK(blink::kDartIsolateSnapshotBuffer);
28 char* error = nullptr; 29 char* error = nullptr;
29 Dart_Isolate isolate = Dart_CreateIsolate("dart:snapshot", "main", 30 Dart_Isolate isolate = Dart_CreateIsolate("dart:snapshot", "main",
30 blink::kDartIsolateSnapshotBuffer, 31 blink::kDartIsolateSnapshotBuffer,
31 nullptr, nullptr, &error); 32 nullptr, nullptr, &error);
32 33
33 CHECK(isolate) << error; 34 CHECK(isolate) << error;
34 CHECK(!LogIfError(Dart_SetLibraryTagHandler(HandleLibraryTag))); 35 CHECK(!LogIfError(Dart_SetLibraryTagHandler(HandleLibraryTag)));
35 36
36 Dart_ExitIsolate(); 37 Dart_ExitIsolate();
37 return isolate; 38 return isolate;
38 } 39 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/widgets/tabs.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698