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

Side by Side Diff: samples/process.cc

Issue 2042253002: [icu] Support loading data file from default location (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Format Created 4 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
« no previous file with comments | « samples/hello-world.cc ('k') | samples/shell.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 680
681 void PrintMap(map<string, string>* m) { 681 void PrintMap(map<string, string>* m) {
682 for (map<string, string>::iterator i = m->begin(); i != m->end(); i++) { 682 for (map<string, string>::iterator i = m->begin(); i != m->end(); i++) {
683 pair<string, string> entry = *i; 683 pair<string, string> entry = *i;
684 printf("%s: %s\n", entry.first.c_str(), entry.second.c_str()); 684 printf("%s: %s\n", entry.first.c_str(), entry.second.c_str());
685 } 685 }
686 } 686 }
687 687
688 688
689 int main(int argc, char* argv[]) { 689 int main(int argc, char* argv[]) {
690 v8::V8::InitializeICU(); 690 v8::V8::InitializeICUDefaultLocation(argv[0]);
691 v8::V8::InitializeExternalStartupData(argv[0]); 691 v8::V8::InitializeExternalStartupData(argv[0]);
692 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); 692 v8::Platform* platform = v8::platform::CreateDefaultPlatform();
693 v8::V8::InitializePlatform(platform); 693 v8::V8::InitializePlatform(platform);
694 v8::V8::Initialize(); 694 v8::V8::Initialize();
695 map<string, string> options; 695 map<string, string> options;
696 string file; 696 string file;
697 ParseOptions(argc, argv, &options, &file); 697 ParseOptions(argc, argv, &options, &file);
698 if (file.empty()) { 698 if (file.empty()) {
699 fprintf(stderr, "No script was specified.\n"); 699 fprintf(stderr, "No script was specified.\n");
700 return 1; 700 return 1;
(...skipping 12 matching lines...) Expand all
713 JsHttpRequestProcessor processor(isolate, source); 713 JsHttpRequestProcessor processor(isolate, source);
714 map<string, string> output; 714 map<string, string> output;
715 if (!processor.Initialize(&options, &output)) { 715 if (!processor.Initialize(&options, &output)) {
716 fprintf(stderr, "Error initializing processor.\n"); 716 fprintf(stderr, "Error initializing processor.\n");
717 return 1; 717 return 1;
718 } 718 }
719 if (!ProcessEntries(platform, &processor, kSampleSize, kSampleRequests)) 719 if (!ProcessEntries(platform, &processor, kSampleSize, kSampleRequests))
720 return 1; 720 return 1;
721 PrintMap(&output); 721 PrintMap(&output);
722 } 722 }
OLDNEW
« no previous file with comments | « samples/hello-world.cc ('k') | samples/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698