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

Side by Side Diff: sky/engine/core/script/dart_controller.cc

Issue 1226773009: Remove GC prolog and epilog (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 | « no previous file | 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/engine/core/script/dart_controller.h" 5 #include "sky/engine/core/script/dart_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 void DartController::CreateIsolateFor(PassOwnPtr<DOMDartState> state) { 124 void DartController::CreateIsolateFor(PassOwnPtr<DOMDartState> state) {
125 CHECK(kDartIsolateSnapshotBuffer); 125 CHECK(kDartIsolateSnapshotBuffer);
126 char* error = nullptr; 126 char* error = nullptr;
127 dom_dart_state_ = state; 127 dom_dart_state_ = state;
128 Dart_Isolate isolate = Dart_CreateIsolate( 128 Dart_Isolate isolate = Dart_CreateIsolate(
129 dom_dart_state_->url().utf8().data(), "main", kDartIsolateSnapshotBuffer, 129 dom_dart_state_->url().utf8().data(), "main", kDartIsolateSnapshotBuffer,
130 nullptr, static_cast<DartState*>(dom_dart_state_.get()), &error); 130 nullptr, static_cast<DartState*>(dom_dart_state_.get()), &error);
131 Dart_SetMessageNotifyCallback(MessageNotifyCallback); 131 Dart_SetMessageNotifyCallback(MessageNotifyCallback);
132 CHECK(isolate) << error; 132 CHECK(isolate) << error;
133 dom_dart_state_->SetIsolate(isolate); 133 dom_dart_state_->SetIsolate(isolate);
134 Dart_SetGcCallbacks(DartGCPrologue, DartGCEpilogue);
135 CHECK(!LogIfError(Dart_SetLibraryTagHandler(DartLibraryTagHandler))); 134 CHECK(!LogIfError(Dart_SetLibraryTagHandler(DartLibraryTagHandler)));
136 135
137 { 136 {
138 DartApiScope apiScope; 137 DartApiScope apiScope;
139 138
140 Builtin::SetNativeResolver(Builtin::kBuiltinLibrary); 139 Builtin::SetNativeResolver(Builtin::kBuiltinLibrary);
141 Builtin::SetNativeResolver(Builtin::kMojoInternalLibrary); 140 Builtin::SetNativeResolver(Builtin::kMojoInternalLibrary);
142 Builtin::SetNativeResolver(Builtin::kIOLibrary); 141 Builtin::SetNativeResolver(Builtin::kIOLibrary);
143 BuiltinNatives::Init(BuiltinNatives::MainIsolate); 142 BuiltinNatives::Init(BuiltinNatives::MainIsolate);
144 143
145 builtin_sky_ = adoptPtr(new BuiltinSky(dart_state())); 144 builtin_sky_ = adoptPtr(new BuiltinSky(dart_state()));
146 dart_state()->class_library().set_provider(builtin_sky_.get()); 145 dart_state()->class_library().set_provider(builtin_sky_.get());
147 146
148 if (dart_state()->document()) 147 if (dart_state()->document())
149 builtin_sky_->InstallWindow(dart_state()); 148 builtin_sky_->InstallWindow(dart_state());
150 149
151 EnsureHandleWatcherStarted(); 150 EnsureHandleWatcherStarted();
152 } 151 }
153 Dart_ExitIsolate(); 152 Dart_ExitIsolate();
154 } 153 }
155 154
156 void DartController::InstallView(View* view) { 155 void DartController::InstallView(View* view) {
157 DartIsolateScope isolate_scope(dart_state()->isolate()); 156 DartIsolateScope isolate_scope(dart_state()->isolate());
158 DartApiScope dart_api_scope; 157 DartApiScope dart_api_scope;
159 158
160 builtin_sky_->InstallView(view); 159 builtin_sky_->InstallView(view);
161 } 160 }
162 161
163 } // namespace blink 162 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698