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

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

Issue 10332109: Make the crypto library an official dart:crypto library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix long line Created 8 years, 7 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
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/gen_snapshot.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 "bin/dartutils.h" 5 #include "bin/dartutils.h"
6 6
7 #include "bin/file.h" 7 #include "bin/file.h"
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/globals.h" 10 #include "platform/globals.h"
11 11
12 const char* DartUtils::kDartScheme = "dart:"; 12 const char* DartUtils::kDartScheme = "dart:";
13 const char* DartUtils::kDartExtensionScheme = "dart-ext:"; 13 const char* DartUtils::kDartExtensionScheme = "dart-ext:";
14 const char* DartUtils::kBuiltinLibURL = "dart:builtin"; 14 const char* DartUtils::kBuiltinLibURL = "dart:builtin";
15 const char* DartUtils::kCoreLibURL = "dart:core"; 15 const char* DartUtils::kCoreLibURL = "dart:core";
16 const char* DartUtils::kCoreImplLibURL = "dart:coreimpl"; 16 const char* DartUtils::kCoreImplLibURL = "dart:coreimpl";
17 const char* DartUtils::kCryptoLibURL = "dart:crypto";
17 const char* DartUtils::kIOLibURL = "dart:io"; 18 const char* DartUtils::kIOLibURL = "dart:io";
18 const char* DartUtils::kJsonLibURL = "dart:json"; 19 const char* DartUtils::kJsonLibURL = "dart:json";
19 const char* DartUtils::kUriLibURL = "dart:uri"; 20 const char* DartUtils::kUriLibURL = "dart:uri";
20 const char* DartUtils::kUtfLibURL = "dart:utf"; 21 const char* DartUtils::kUtfLibURL = "dart:utf";
21 const char* DartUtils::kIsolateLibURL = "dart:isolate"; 22 const char* DartUtils::kIsolateLibURL = "dart:isolate";
22 23
23 24
24 const char* DartUtils::kIdFieldName = "_id"; 25 const char* DartUtils::kIdFieldName = "_id";
25 26
26 27
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 108
108 bool DartUtils::IsDartExtensionSchemeURL(const char* url_name) { 109 bool DartUtils::IsDartExtensionSchemeURL(const char* url_name) {
109 static const intptr_t kDartExtensionSchemeLen = strlen(kDartExtensionScheme); 110 static const intptr_t kDartExtensionSchemeLen = strlen(kDartExtensionScheme);
110 // If the URL starts with "dartext:" then it is considered as a special 111 // If the URL starts with "dartext:" then it is considered as a special
111 // extension library URL which is handled differently from other URLs. 112 // extension library URL which is handled differently from other URLs.
112 return 113 return
113 (strncmp(url_name, kDartExtensionScheme, kDartExtensionSchemeLen) == 0); 114 (strncmp(url_name, kDartExtensionScheme, kDartExtensionSchemeLen) == 0);
114 } 115 }
115 116
116 117
118 bool DartUtils::IsDartCryptoLibURL(const char* url_name) {
119 return (strcmp(url_name, kCryptoLibURL) == 0);
120 }
121
122
117 bool DartUtils::IsDartIOLibURL(const char* url_name) { 123 bool DartUtils::IsDartIOLibURL(const char* url_name) {
118 return (strcmp(url_name, kIOLibURL) == 0); 124 return (strcmp(url_name, kIOLibURL) == 0);
119 } 125 }
120 126
121 127
122 bool DartUtils::IsDartJsonLibURL(const char* url_name) { 128 bool DartUtils::IsDartJsonLibURL(const char* url_name) {
123 return (strcmp(url_name, kJsonLibURL) == 0); 129 return (strcmp(url_name, kJsonLibURL) == 0);
124 } 130 }
125 131
126 132
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 439
434 CObject* CObject::NewOSError(OSError* os_error) { 440 CObject* CObject::NewOSError(OSError* os_error) {
435 CObject* error_message = 441 CObject* error_message =
436 new CObjectString(CObject::NewString(os_error->message())); 442 new CObjectString(CObject::NewString(os_error->message()));
437 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); 443 CObjectArray* result = new CObjectArray(CObject::NewArray(3));
438 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); 444 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError)));
439 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); 445 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code())));
440 result->SetAt(2, error_message); 446 result->SetAt(2, error_message);
441 return result; 447 return result;
442 } 448 }
OLDNEW
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/gen_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698