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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 920813003: Refactor service code and service method parameters (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/dart.cc ('k') | runtime/vm/debugger.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 12 matching lines...) Expand all
23 #include "vm/message.h" 23 #include "vm/message.h"
24 #include "vm/message_handler.h" 24 #include "vm/message_handler.h"
25 #include "vm/native_entry.h" 25 #include "vm/native_entry.h"
26 #include "vm/object.h" 26 #include "vm/object.h"
27 #include "vm/object_store.h" 27 #include "vm/object_store.h"
28 #include "vm/os_thread.h" 28 #include "vm/os_thread.h"
29 #include "vm/port.h" 29 #include "vm/port.h"
30 #include "vm/profiler.h" 30 #include "vm/profiler.h"
31 #include "vm/resolver.h" 31 #include "vm/resolver.h"
32 #include "vm/reusable_handles.h" 32 #include "vm/reusable_handles.h"
33 #include "vm/service_isolate.h"
33 #include "vm/service.h" 34 #include "vm/service.h"
34 #include "vm/stack_frame.h" 35 #include "vm/stack_frame.h"
35 #include "vm/symbols.h" 36 #include "vm/symbols.h"
36 #include "vm/tags.h" 37 #include "vm/tags.h"
37 #include "vm/timer.h" 38 #include "vm/timer.h"
38 #include "vm/unicode.h" 39 #include "vm/unicode.h"
39 #include "vm/verifier.h" 40 #include "vm/verifier.h"
40 #include "vm/version.h" 41 #include "vm/version.h"
41 42
42 namespace dart { 43 namespace dart {
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 const char* main) { 1246 const char* main) {
1246 if (script_uri == NULL) { 1247 if (script_uri == NULL) {
1247 // Just use the main as the name. 1248 // Just use the main as the name.
1248 if (main == NULL) { 1249 if (main == NULL) {
1249 return strdup("isolate"); 1250 return strdup("isolate");
1250 } else { 1251 } else {
1251 return strdup(main); 1252 return strdup(main);
1252 } 1253 }
1253 } 1254 }
1254 1255
1255 if (Service::IsServiceIsolateName(script_uri)) { 1256 if (ServiceIsolate::NameEquals(script_uri)) {
1256 return strdup(script_uri); 1257 return strdup(script_uri);
1257 } 1258 }
1258 1259
1259 // Skip past any slashes and backslashes in the script uri. 1260 // Skip past any slashes and backslashes in the script uri.
1260 const char* last_slash = strrchr(script_uri, '/'); 1261 const char* last_slash = strrchr(script_uri, '/');
1261 if (last_slash != NULL) { 1262 if (last_slash != NULL) {
1262 script_uri = last_slash + 1; 1263 script_uri = last_slash + 1;
1263 } 1264 }
1264 const char* last_backslash = strrchr(script_uri, '\\'); 1265 const char* last_backslash = strrchr(script_uri, '\\');
1265 if (last_backslash != NULL) { 1266 if (last_backslash != NULL) {
(...skipping 4184 matching lines...) Expand 10 before | Expand all | Expand 10 after
5450 isolate->heap()->SetPeer(raw_obj, peer); 5451 isolate->heap()->SetPeer(raw_obj, peer);
5451 } 5452 }
5452 return Api::Success(); 5453 return Api::Success();
5453 } 5454 }
5454 5455
5455 5456
5456 // --- Service support --- 5457 // --- Service support ---
5457 5458
5458 DART_EXPORT bool Dart_IsServiceIsolate(Dart_Isolate isolate) { 5459 DART_EXPORT bool Dart_IsServiceIsolate(Dart_Isolate isolate) {
5459 Isolate* iso = reinterpret_cast<Isolate*>(isolate); 5460 Isolate* iso = reinterpret_cast<Isolate*>(isolate);
5460 return Service::IsServiceIsolate(iso); 5461 return ServiceIsolate::IsServiceIsolate(iso);
5461 } 5462 }
5462 5463
5463 5464
5464 DART_EXPORT Dart_Port Dart_ServiceWaitForLoadPort() { 5465 DART_EXPORT Dart_Port Dart_ServiceWaitForLoadPort() {
5465 return Service::WaitForLoadPort(); 5466 return ServiceIsolate::WaitForLoadPort();
5466 } 5467 }
5467 5468
5468 5469
5469 DART_EXPORT void Dart_RegisterIsolateServiceRequestCallback( 5470 DART_EXPORT void Dart_RegisterIsolateServiceRequestCallback(
5470 const char* name, 5471 const char* name,
5471 Dart_ServiceRequestCallback callback, 5472 Dart_ServiceRequestCallback callback,
5472 void* user_data) { 5473 void* user_data) {
5473 Service::RegisterIsolateEmbedderCallback(name, callback, user_data); 5474 Service::RegisterIsolateEmbedderCallback(name, callback, user_data);
5474 } 5475 }
5475 5476
5476 5477
5477 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( 5478 DART_EXPORT void Dart_RegisterRootServiceRequestCallback(
5478 const char* name, 5479 const char* name,
5479 Dart_ServiceRequestCallback callback, 5480 Dart_ServiceRequestCallback callback,
5480 void* user_data) { 5481 void* user_data) {
5481 Service::RegisterRootEmbedderCallback(name, callback, user_data); 5482 Service::RegisterRootEmbedderCallback(name, callback, user_data);
5482 } 5483 }
5483 5484
5484 } // namespace dart 5485 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698