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

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

Issue 8383037: Improve error handling in the process library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 2 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_in.cc ('k') | runtime/bin/eventhandler.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 const char* DartUtils::kBuiltinLibURL = "./dart:builtin-lib"; 7 const char* DartUtils::kBuiltinLibURL = "./dart:builtin-lib";
8 const char* DartUtils::kBuiltinLibSpec = "library { }"; 8 const char* DartUtils::kBuiltinLibSpec = "library { }";
9 const char* DartUtils::kIdFieldName = "_id"; 9 const char* DartUtils::kIdFieldName = "_id";
10 10
11 11
12 int64_t DartUtils::GetIntegerValue(Dart_Handle value_obj) { 12 int64_t DartUtils::GetIntegerValue(Dart_Handle value_obj) {
13 assert(Dart_IsInteger(value_obj)); 13 ASSERT(Dart_IsInteger(value_obj));
14 Dart_Result result = Dart_IntegerValue(value_obj); 14 Dart_Result result = Dart_IntegerValue(value_obj);
15 ASSERT(Dart_IsValidResult(result)); 15 ASSERT(Dart_IsValidResult(result));
16 return Dart_GetResultAsCInt64(result); 16 return Dart_GetResultAsCInt64(result);
17 } 17 }
18 18
19 const char* DartUtils::GetStringValue(Dart_Handle str_obj) { 19 const char* DartUtils::GetStringValue(Dart_Handle str_obj) {
20 Dart_Result result = Dart_StringToCString(str_obj); 20 Dart_Result result = Dart_StringToCString(str_obj);
21 ASSERT(Dart_IsValidResult(result)); 21 ASSERT(Dart_IsValidResult(result));
22 return Dart_GetResultAsCString(result); 22 return Dart_GetResultAsCString(result);
23 } 23 }
(...skipping 11 matching lines...) Expand all
35 Dart_Result result = Dart_SetInstanceField(handle, 35 Dart_Result result = Dart_SetInstanceField(handle,
36 Dart_NewString(name), 36 Dart_NewString(name),
37 Dart_NewInteger(val)); 37 Dart_NewInteger(val));
38 ASSERT(Dart_IsValidResult(result)); 38 ASSERT(Dart_IsValidResult(result));
39 } 39 }
40 40
41 intptr_t DartUtils::GetIntegerInstanceField(Dart_Handle handle, 41 intptr_t DartUtils::GetIntegerInstanceField(Dart_Handle handle,
42 const char* name) { 42 const char* name) {
43 Dart_Result result = 43 Dart_Result result =
44 Dart_GetInstanceField(handle, Dart_NewString(name)); 44 Dart_GetInstanceField(handle, Dart_NewString(name));
45 assert(Dart_IsValidResult(result)); 45 ASSERT(Dart_IsValidResult(result));
46 intptr_t value = DartUtils::GetIntegerValue(Dart_GetResult(result)); 46 intptr_t value = DartUtils::GetIntegerValue(Dart_GetResult(result));
47 return value; 47 return value;
48 } 48 }
49 49
50 void DartUtils::SetStringInstanceField(Dart_Handle handle, 50 void DartUtils::SetStringInstanceField(Dart_Handle handle,
51 const char* name, 51 const char* name,
52 const char* val) { 52 const char* val) {
53 Dart_Result result = Dart_SetInstanceField(handle, 53 Dart_Result result = Dart_SetInstanceField(handle,
54 Dart_NewString(name), 54 Dart_NewString(name),
55 Dart_NewString(val)); 55 Dart_NewString(val));
56 ASSERT(Dart_IsValidResult(result)); 56 ASSERT(Dart_IsValidResult(result));
57 } 57 }
OLDNEW
« no previous file with comments | « runtime/bin/builtin_in.cc ('k') | runtime/bin/eventhandler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698