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

Side by Side Diff: runtime/bin/dartutils.cc

Issue 133893007: Rename internal library dart:_collection-dev to dart:_internal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typo in dart2js Symbol lookup. Created 6 years, 11 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 | Annotate | Revision Log
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 "bin/dartutils.h" 5 #include "bin/dartutils.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 9
10 #include "platform/assert.h" 10 #include "platform/assert.h"
11 #include "platform/globals.h" 11 #include "platform/globals.h"
12 12
13 #include "bin/crypto.h" 13 #include "bin/crypto.h"
14 #include "bin/directory.h" 14 #include "bin/directory.h"
15 #include "bin/extensions.h" 15 #include "bin/extensions.h"
16 #include "bin/file.h" 16 #include "bin/file.h"
17 #include "bin/io_buffer.h" 17 #include "bin/io_buffer.h"
18 #include "bin/socket.h" 18 #include "bin/socket.h"
19 #include "bin/utils.h" 19 #include "bin/utils.h"
20 20
21 namespace dart { 21 namespace dart {
22 namespace bin { 22 namespace bin {
23 23
24 const char* DartUtils::original_working_directory = NULL; 24 const char* DartUtils::original_working_directory = NULL;
25 const char* DartUtils::kDartScheme = "dart:"; 25 const char* DartUtils::kDartScheme = "dart:";
26 const char* DartUtils::kDartExtensionScheme = "dart-ext:"; 26 const char* DartUtils::kDartExtensionScheme = "dart-ext:";
27 const char* DartUtils::kAsyncLibURL = "dart:async"; 27 const char* DartUtils::kAsyncLibURL = "dart:async";
28 const char* DartUtils::kBuiltinLibURL = "dart:builtin"; 28 const char* DartUtils::kBuiltinLibURL = "dart:builtin";
29 const char* DartUtils::kCollectionDevLibURL = "dart:_collection-dev"; 29 const char* DartUtils::kInternalLibURL = "dart:_internal";
floitsch 2014/01/14 19:21:01 The URLs were sorted.
Lasse Reichstein Nielsen 2014/01/15 09:27:42 Done.
30 const char* DartUtils::kCoreLibURL = "dart:core"; 30 const char* DartUtils::kCoreLibURL = "dart:core";
31 const char* DartUtils::kIsolateLibURL = "dart:isolate"; 31 const char* DartUtils::kIsolateLibURL = "dart:isolate";
32 const char* DartUtils::kIOLibURL = "dart:io"; 32 const char* DartUtils::kIOLibURL = "dart:io";
33 const char* DartUtils::kIOLibPatchURL = "dart:io-patch"; 33 const char* DartUtils::kIOLibPatchURL = "dart:io-patch";
34 const char* DartUtils::kUriLibURL = "dart:uri"; 34 const char* DartUtils::kUriLibURL = "dart:uri";
35 const char* DartUtils::kHttpScheme = "http:"; 35 const char* DartUtils::kHttpScheme = "http:";
36 36
37 const char* DartUtils::kIdFieldName = "_id"; 37 const char* DartUtils::kIdFieldName = "_id";
38 38
39 uint8_t DartUtils::magic_number[] = { 0xf5, 0xf5, 0xdc, 0xdc }; 39 uint8_t DartUtils::magic_number[] = { 0xf5, 0xf5, 0xdc, 0xdc };
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 } 675 }
676 return Dart_NewApiError("wrong tag"); 676 return Dart_NewApiError("wrong tag");
677 } 677 }
678 678
679 679
680 Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root, 680 Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root,
681 Dart_Handle builtin_lib) { 681 Dart_Handle builtin_lib) {
682 // Setup the internal library's 'internalPrint' function. 682 // Setup the internal library's 'internalPrint' function.
683 Dart_Handle print = Dart_Invoke( 683 Dart_Handle print = Dart_Invoke(
684 builtin_lib, NewString("_getPrintClosure"), 0, NULL); 684 builtin_lib, NewString("_getPrintClosure"), 0, NULL);
685 Dart_Handle url = NewString(kCollectionDevLibURL); 685 Dart_Handle url = NewString(kInternalLibURL);
686 DART_CHECK_VALID(url); 686 DART_CHECK_VALID(url);
687 Dart_Handle collection_dev_lib = Dart_LookupLibrary(url); 687 Dart_Handle internal_lib = Dart_LookupLibrary(url);
688 DART_CHECK_VALID(collection_dev_lib); 688 DART_CHECK_VALID(internal_lib);
689 Dart_Handle result = Dart_SetField(collection_dev_lib, 689 Dart_Handle result = Dart_SetField(internal_lib,
690 NewString("_printClosure"), 690 NewString("_printClosure"),
691 print); 691 print);
692 DART_CHECK_VALID(result); 692 DART_CHECK_VALID(result);
693 693
694 // Setup the 'timer' factory. 694 // Setup the 'timer' factory.
695 url = NewString(kAsyncLibURL); 695 url = NewString(kAsyncLibURL);
696 DART_CHECK_VALID(url); 696 DART_CHECK_VALID(url);
697 Dart_Handle async_lib = Dart_LookupLibrary(url); 697 Dart_Handle async_lib = Dart_LookupLibrary(url);
698 DART_CHECK_VALID(async_lib); 698 DART_CHECK_VALID(async_lib);
699 Dart_Handle io_lib = Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary); 699 Dart_Handle io_lib = Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary);
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 new CObjectString(CObject::NewString(os_error->message())); 1076 new CObjectString(CObject::NewString(os_error->message()));
1077 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); 1077 CObjectArray* result = new CObjectArray(CObject::NewArray(3));
1078 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); 1078 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError)));
1079 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); 1079 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code())));
1080 result->SetAt(2, error_message); 1080 result->SetAt(2, error_message);
1081 return result; 1081 return result;
1082 } 1082 }
1083 1083
1084 } // namespace bin 1084 } // namespace bin
1085 } // namespace dart 1085 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698