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

Side by Side Diff: bin/dartutils.h

Issue 11275008: - Represent strings internally in UTF-16 format, this makes it (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 1 month 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 | « bin/crypto.cc ('k') | bin/dartutils.cc » ('j') | bin/dartutils.cc » ('J')
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 #ifndef BIN_DARTUTILS_H_ 5 #ifndef BIN_DARTUTILS_H_
6 #define BIN_DARTUTILS_H_ 6 #define BIN_DARTUTILS_H_
7 7
8 #include "bin/builtin.h" 8 #include "bin/builtin.h"
9 #include "bin/utils.h" 9 #include "bin/utils.h"
10 #include "include/dart_api.h" 10 #include "include/dart_api.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 Dart_Handle builtin_lib); 103 Dart_Handle builtin_lib);
104 104
105 static bool PostNull(Dart_Port port_id); 105 static bool PostNull(Dart_Port port_id);
106 static bool PostInt32(Dart_Port port_id, int32_t value); 106 static bool PostInt32(Dart_Port port_id, int32_t value);
107 107
108 // Create a new Dart OSError object with the current OS error. 108 // Create a new Dart OSError object with the current OS error.
109 static Dart_Handle NewDartOSError(); 109 static Dart_Handle NewDartOSError();
110 // Create a new Dart OSError object with the provided OS error. 110 // Create a new Dart OSError object with the provided OS error.
111 static Dart_Handle NewDartOSError(OSError* os_error); 111 static Dart_Handle NewDartOSError(OSError* os_error);
112 112
113 // Create a new Dart String object from a C String.
114 static Dart_Handle NewString(const char* str) {
115 ASSERT((str != NULL) && (strlen(str) != 0));
116 return Dart_NewStringFromUTF8(reinterpret_cast<const uint8_t*>(str),
117 strlen(str));
118 }
119
113 static void SetOriginalWorkingDirectory(); 120 static void SetOriginalWorkingDirectory();
114 121
115 // Global state that stores the original working directory.. 122 // Global state that stores the original working directory..
116 static const char* original_working_directory; 123 static const char* original_working_directory;
117 124
118 static const char* kDartScheme; 125 static const char* kDartScheme;
119 static const char* kDartExtensionScheme; 126 static const char* kDartExtensionScheme;
120 static const char* kBuiltinLibURL; 127 static const char* kBuiltinLibURL;
121 static const char* kCoreLibURL; 128 static const char* kCoreLibURL;
122 static const char* kCoreImplLibURL; 129 static const char* kCoreImplLibURL;
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 void* Peer() const { return cobject_->value.as_external_byte_array.peer; } 369 void* Peer() const { return cobject_->value.as_external_byte_array.peer; }
363 Dart_PeerFinalizer Callback() const { 370 Dart_PeerFinalizer Callback() const {
364 return cobject_->value.as_external_byte_array.callback; 371 return cobject_->value.as_external_byte_array.callback;
365 } 372 }
366 373
367 private: 374 private:
368 DISALLOW_COPY_AND_ASSIGN(CObjectExternalUint8Array); 375 DISALLOW_COPY_AND_ASSIGN(CObjectExternalUint8Array);
369 }; 376 };
370 377
371 #endif // BIN_DARTUTILS_H_ 378 #endif // BIN_DARTUTILS_H_
OLDNEW
« no previous file with comments | « bin/crypto.cc ('k') | bin/dartutils.cc » ('j') | bin/dartutils.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698