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

Unified Diff: runtime/bin/vmservice_impl.cc

Issue 837723004: Build Observatory as part of runtime (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/vmservice_impl.h ('k') | runtime/dart-runtime.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice_impl.cc
diff --git a/runtime/bin/vmservice_impl.cc b/runtime/bin/vmservice_impl.cc
index 99e8148065a153e0dd889e632f04a3b76568ceec..18f06c1c3c02f446abe6527511e188de646bad62 100644
--- a/runtime/bin/vmservice_impl.cc
+++ b/runtime/bin/vmservice_impl.cc
@@ -31,7 +31,6 @@ namespace bin {
#define kLibrarySourceNamePrefix "/vmservice"
static const char* kVMServiceIOLibraryScriptResourceName = "vmservice_io.dart";
-#define kClientResourceNamePrefix "/vmservice/observatory/deployed/web"
struct ResourcesEntry {
const char* path_;
@@ -246,17 +245,15 @@ Dart_Handle VmService::LoadSource(Dart_Handle library, const char* name) {
Dart_Handle VmService::LoadResource(Dart_Handle library,
- const char* resource_name,
- const char* prefix) {
- intptr_t prefix_len = strlen(prefix);
+ const char* resource_name) {
// Prepare for invoke call.
- Dart_Handle name = Dart_NewStringFromCString(resource_name+prefix_len);
+ Dart_Handle name = Dart_NewStringFromCString(resource_name);
RETURN_ERROR_HANDLE(name);
const char* data_buffer = NULL;
int data_buffer_length = Resources::ResourceLookup(resource_name,
&data_buffer);
if (data_buffer_length == Resources::kNoSuchInstance) {
- printf("Could not find %s %s\n", resource_name, resource_name+prefix_len);
+ printf("Could not find %s %s\n", resource_name, resource_name);
}
ASSERT(data_buffer_length != Resources::kNoSuchInstance);
Dart_Handle data_list = Dart_NewTypedData(Dart_TypedData_kUint8,
@@ -287,11 +284,13 @@ Dart_Handle VmService::LoadResource(Dart_Handle library,
Dart_Handle VmService::LoadResources(Dart_Handle library) {
Dart_Handle result = Dart_Null();
- intptr_t prefixLen = strlen(kClientResourceNamePrefix);
+ intptr_t prefixLen = strlen(kLibrarySourceNamePrefix);
for (intptr_t i = 0; Resources::Path(i) != NULL; i++) {
const char* path = Resources::Path(i);
- if (!strncmp(path, kClientResourceNamePrefix, prefixLen)) {
- result = LoadResource(library, path, kClientResourceNamePrefix);
+ // If it doesn't begin with kLibrarySourceNamePrefix it is a frontend
+ // resource.
+ if (strncmp(path, kLibrarySourceNamePrefix, prefixLen) != 0) {
+ result = LoadResource(library, path);
if (Dart_IsError(result)) {
break;
}
« no previous file with comments | « runtime/bin/vmservice_impl.h ('k') | runtime/dart-runtime.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698