| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 host_(host), | 528 host_(host), |
| 529 user_agent_(user_agent) { } | 529 user_agent_(user_agent) { } |
| 530 | 530 |
| 531 | 531 |
| 532 void ParseOptions(int argc, | 532 void ParseOptions(int argc, |
| 533 char* argv[], | 533 char* argv[], |
| 534 map<string, string>& options, | 534 map<string, string>& options, |
| 535 string* file) { | 535 string* file) { |
| 536 for (int i = 1; i < argc; i++) { | 536 for (int i = 1; i < argc; i++) { |
| 537 string arg = argv[i]; | 537 string arg = argv[i]; |
| 538 int index = arg.find('=', 0); | 538 size_t index = arg.find('=', 0); |
| 539 if (index == string::npos) { | 539 if (index == string::npos) { |
| 540 *file = arg; | 540 *file = arg; |
| 541 } else { | 541 } else { |
| 542 string key = arg.substr(0, index); | 542 string key = arg.substr(0, index); |
| 543 string value = arg.substr(index+1); | 543 string value = arg.substr(index+1); |
| 544 options[key] = value; | 544 options[key] = value; |
| 545 } | 545 } |
| 546 } | 546 } |
| 547 } | 547 } |
| 548 | 548 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 JsHttpRequestProcessor processor(source); | 615 JsHttpRequestProcessor processor(source); |
| 616 map<string, string> output; | 616 map<string, string> output; |
| 617 if (!processor.Initialize(&options, &output)) { | 617 if (!processor.Initialize(&options, &output)) { |
| 618 fprintf(stderr, "Error initializing processor.\n"); | 618 fprintf(stderr, "Error initializing processor.\n"); |
| 619 return 1; | 619 return 1; |
| 620 } | 620 } |
| 621 if (!ProcessEntries(&processor, kSampleSize, kSampleRequests)) | 621 if (!ProcessEntries(&processor, kSampleSize, kSampleRequests)) |
| 622 return 1; | 622 return 1; |
| 623 PrintMap(&output); | 623 PrintMap(&output); |
| 624 } | 624 } |
| OLD | NEW |