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

Side by Side Diff: samples/sample_extension/sample_extension.cc

Issue 227433004: Add runtime and native entry tags (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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/vm/unit_test.cc ('k') | no next file » | 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 #include <string.h> 4 #include <string.h>
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <stdio.h> 6 #include <stdio.h>
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 10
11 Dart_NativeFunction ResolveName(Dart_Handle name, 11 Dart_NativeFunction ResolveName(Dart_Handle name,
12 int argc, 12 int argc,
13 bool* auto_setup_scope); 13 bool* auto_setup_scope);
14 14
15 15
16 DART_EXPORT Dart_Handle sample_extension_Init(Dart_Handle parent_library) { 16 DART_EXPORT Dart_Handle sample_extension_Init(Dart_Handle parent_library) {
17 if (Dart_IsError(parent_library)) { 17 if (Dart_IsError(parent_library)) {
18 return parent_library; 18 return parent_library;
19 } 19 }
20 20
21 Dart_Handle result_code = Dart_SetNativeResolver(parent_library, ResolveName); 21 Dart_Handle result_code =
22 Dart_SetNativeResolver(parent_library, ResolveName, NULL);
22 if (Dart_IsError(result_code)) { 23 if (Dart_IsError(result_code)) {
23 return result_code; 24 return result_code;
24 } 25 }
25 26
26 return Dart_Null(); 27 return Dart_Null();
27 } 28 }
28 29
29 30
30 Dart_Handle HandleError(Dart_Handle handle) { 31 Dart_Handle HandleError(Dart_Handle handle) {
31 if (Dart_IsError(handle)) { 32 if (Dart_IsError(handle)) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 if (strcmp(no_scope_function_list[i].name, cname) == 0) { 179 if (strcmp(no_scope_function_list[i].name, cname) == 0) {
179 *auto_setup_scope = false; 180 *auto_setup_scope = false;
180 result = no_scope_function_list[i].function; 181 result = no_scope_function_list[i].function;
181 break; 182 break;
182 } 183 }
183 } 184 }
184 185
185 Dart_ExitScope(); 186 Dart_ExitScope();
186 return result; 187 return result;
187 } 188 }
OLDNEW
« no previous file with comments | « runtime/vm/unit_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698