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

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

Issue 466813002: Support non-ASCII script URLs in VM service by using IRIs (generalized URIs). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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/object_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) 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 "vm/service.h" 5 #include "vm/service.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/globals.h" 8 #include "platform/globals.h"
9 9
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 if (js->num_arguments() > 5) { 1450 if (js->num_arguments() > 5) {
1451 PrintError(js, "Command too long"); 1451 PrintError(js, "Command too long");
1452 return true; 1452 return true;
1453 } else if (js->num_arguments() < 4) { 1453 } else if (js->num_arguments() < 4) {
1454 PrintError(js, "Must specify collection object id: scripts/id"); 1454 PrintError(js, "Must specify collection object id: scripts/id");
1455 return true; 1455 return true;
1456 } 1456 }
1457 const String& id = String::Handle(String::New(js->GetArgument(3))); 1457 const String& id = String::Handle(String::New(js->GetArgument(3)));
1458 ASSERT(!id.IsNull()); 1458 ASSERT(!id.IsNull());
1459 // The id is the url of the script % encoded, decode it. 1459 // The id is the url of the script % encoded, decode it.
1460 const String& requested_url = String::Handle(String::DecodeURI(id)); 1460 const String& requested_url = String::Handle(String::DecodeIRI(id));
1461 Script& script = Script::Handle(); 1461 Script& script = Script::Handle();
1462 String& script_url = String::Handle(); 1462 String& script_url = String::Handle();
1463 const Array& loaded_scripts = Array::Handle(lib.LoadedScripts()); 1463 const Array& loaded_scripts = Array::Handle(lib.LoadedScripts());
1464 ASSERT(!loaded_scripts.IsNull()); 1464 ASSERT(!loaded_scripts.IsNull());
1465 intptr_t i; 1465 intptr_t i;
1466 for (i = 0; i < loaded_scripts.Length(); i++) { 1466 for (i = 0; i < loaded_scripts.Length(); i++) {
1467 script ^= loaded_scripts.At(i); 1467 script ^= loaded_scripts.At(i);
1468 ASSERT(!script.IsNull()); 1468 ASSERT(!script.IsNull());
1469 script_url ^= script.url(); 1469 script_url ^= script.url();
1470 if (script_url.Equals(requested_url)) { 1470 if (script_url.Equals(requested_url)) {
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
2524 while (current != NULL) { 2524 while (current != NULL) {
2525 if (strcmp(name, current->name()) == 0) { 2525 if (strcmp(name, current->name()) == 0) {
2526 return current; 2526 return current;
2527 } 2527 }
2528 current = current->next(); 2528 current = current->next();
2529 } 2529 }
2530 return NULL; 2530 return NULL;
2531 } 2531 }
2532 2532
2533 } // namespace dart 2533 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698