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

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

Issue 9699017: Start better error reporting for sockets (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed bug Created 8 years, 9 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/builtin_natives.cc ('k') | runtime/bin/dartutils.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 #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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 static Dart_CObject* NewString(const char* str); 158 static Dart_CObject* NewString(const char* str);
159 static Dart_CObject* NewArray(int length); 159 static Dart_CObject* NewArray(int length);
160 static Dart_CObject* NewByteArray(int length); 160 static Dart_CObject* NewByteArray(int length);
161 161
162 Dart_CObject* AsApiCObject() { return cobject_; } 162 Dart_CObject* AsApiCObject() { return cobject_; }
163 163
164 // Create a new CObject array with an illegal arguments error. 164 // Create a new CObject array with an illegal arguments error.
165 static CObject* IllegalArgumentError(); 165 static CObject* IllegalArgumentError();
166 // Create a new CObject array with the current OS error. 166 // Create a new CObject array with the current OS error.
167 static CObject* NewOSError(); 167 static CObject* NewOSError();
168 // Create a new CObject array with the specified OS error.
169 static CObject* NewOSError(OSError* os_error);
168 170
169 protected: 171 protected:
170 CObject() : cobject_(NULL) {} 172 CObject() : cobject_(NULL) {}
171 Dart_CObject* cobject_; 173 Dart_CObject* cobject_;
172 174
173 private: 175 private:
174 static Dart_CObject* New(Dart_CObject::Type type, int additional_bytes = 0); 176 static Dart_CObject* New(Dart_CObject::Type type, int additional_bytes = 0);
175 177
176 static Dart_CObject api_null_; 178 static Dart_CObject api_null_;
177 static Dart_CObject api_true_; 179 static Dart_CObject api_true_;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 286
285 class CObjectByteArray : public CObject { 287 class CObjectByteArray : public CObject {
286 public: 288 public:
287 DECLARE_COBJECT_CONSTRUCTORS(ByteArray) 289 DECLARE_COBJECT_CONSTRUCTORS(ByteArray)
288 290
289 int Length() const { return cobject_->value.as_byte_array.length; } 291 int Length() const { return cobject_->value.as_byte_array.length; }
290 uint8_t* Buffer() const { return cobject_->value.as_byte_array.values; } 292 uint8_t* Buffer() const { return cobject_->value.as_byte_array.values; }
291 }; 293 };
292 294
293 #endif // BIN_DARTUTILS_H_ 295 #endif // BIN_DARTUTILS_H_
OLDNEW
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/bin/dartutils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698