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

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

Issue 16973003: Split dart_api.h into multiple parts: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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/native_message_handler.h ('k') | samples/sample_extension/sample_extension.gyp » ('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 #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 "dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_native_api.h"
8 9
9 Dart_NativeFunction ResolveName(Dart_Handle name, int argc); 10 Dart_NativeFunction ResolveName(Dart_Handle name, int argc);
10 11
11 DART_EXPORT Dart_Handle sample_extension_Init(Dart_Handle parent_library) { 12 DART_EXPORT Dart_Handle sample_extension_Init(Dart_Handle parent_library) {
12 if (Dart_IsError(parent_library)) { return parent_library; } 13 if (Dart_IsError(parent_library)) { return parent_library; }
13 14
14 Dart_Handle result_code = Dart_SetNativeResolver(parent_library, ResolveName); 15 Dart_Handle result_code = Dart_SetNativeResolver(parent_library, ResolveName);
15 if (Dart_IsError(result_code)) return result_code; 16 if (Dart_IsError(result_code)) return result_code;
16 17
17 return Dart_Null(); 18 return Dart_Null();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 126
126 for (int i=0; function_list[i].name != NULL; ++i) { 127 for (int i=0; function_list[i].name != NULL; ++i) {
127 if (strcmp(function_list[i].name, cname) == 0) { 128 if (strcmp(function_list[i].name, cname) == 0) {
128 result = function_list[i].function; 129 result = function_list[i].function;
129 break; 130 break;
130 } 131 }
131 } 132 }
132 Dart_ExitScope(); 133 Dart_ExitScope();
133 return result; 134 return result;
134 } 135 }
OLDNEW
« no previous file with comments | « runtime/vm/native_message_handler.h ('k') | samples/sample_extension/sample_extension.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698