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

Side by Side Diff: runtime/lib/isolate.cc

Issue 1473403003: Move ApiLocalScope out of class ApiState into class Thread so that the API local handles and zone e… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-patch Created 5 years 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 | runtime/vm/benchmark_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "include/dart_native_api.h" 5 #include "include/dart_native_api.h"
6 #include "platform/assert.h" 6 #include "platform/assert.h"
7 #include "vm/bootstrap_natives.h" 7 #include "vm/bootstrap_natives.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/dart.h" 9 #include "vm/dart.h"
10 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 const Library& library, 266 const Library& library,
267 const String& uri, 267 const String& uri,
268 char** error) { 268 char** error) {
269 char* result = NULL; 269 char* result = NULL;
270 Zone* zone = thread->zone(); 270 Zone* zone = thread->zone();
271 Isolate* isolate = thread->isolate(); 271 Isolate* isolate = thread->isolate();
272 Dart_LibraryTagHandler handler = isolate->library_tag_handler(); 272 Dart_LibraryTagHandler handler = isolate->library_tag_handler();
273 if (handler != NULL) { 273 if (handler != NULL) {
274 Dart_EnterScope(); 274 Dart_EnterScope();
275 Dart_Handle handle = handler(Dart_kCanonicalizeUrl, 275 Dart_Handle handle = handler(Dart_kCanonicalizeUrl,
276 Api::NewHandle(isolate, library.raw()), 276 Api::NewHandle(thread, library.raw()),
277 Api::NewHandle(isolate, uri.raw())); 277 Api::NewHandle(thread, uri.raw()));
278 const Object& obj = Object::Handle(Api::UnwrapHandle(handle)); 278 const Object& obj = Object::Handle(Api::UnwrapHandle(handle));
279 if (obj.IsString()) { 279 if (obj.IsString()) {
280 result = String2UTF8(String::Cast(obj)); 280 result = String2UTF8(String::Cast(obj));
281 } else if (obj.IsError()) { 281 } else if (obj.IsError()) {
282 Error& error_obj = Error::Handle(); 282 Error& error_obj = Error::Handle();
283 error_obj ^= obj.raw(); 283 error_obj ^= obj.raw();
284 *error = zone->PrintToString("Unable to canonicalize uri '%s': %s", 284 *error = zone->PrintToString("Unable to canonicalize uri '%s': %s",
285 uri.ToCString(), error_obj.ToErrorCString()); 285 uri.ToCString(), error_obj.ToErrorCString());
286 } else { 286 } else {
287 *error = zone->PrintToString("Unable to canonicalize uri '%s': " 287 *error = zone->PrintToString("Unable to canonicalize uri '%s': "
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 MessageWriter writer(&data, &allocator, false); 412 MessageWriter writer(&data, &allocator, false);
413 writer.WriteMessage(msg); 413 writer.WriteMessage(msg);
414 414
415 PortMap::PostMessage(new Message(port.Id(), 415 PortMap::PostMessage(new Message(port.Id(),
416 data, writer.BytesWritten(), 416 data, writer.BytesWritten(),
417 Message::kOOBPriority)); 417 Message::kOOBPriority));
418 return Object::null(); 418 return Object::null();
419 } 419 }
420 420
421 } // namespace dart 421 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/benchmark_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698