| 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 12 matching lines...) Expand all Loading... |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #include <v8.h> | 28 #include <v8.h> |
| 29 | 29 |
| 30 #include <string> | 30 #include <string> |
| 31 #include <map> | 31 #include <map> |
| 32 | 32 |
| 33 #ifdef COMPRESS_STARTUP_DATA_BZ2 |
| 34 #error Using compressed startup data is not supported for this sample |
| 35 #endif |
| 36 |
| 33 using namespace std; | 37 using namespace std; |
| 34 using namespace v8; | 38 using namespace v8; |
| 35 | 39 |
| 36 // These interfaces represent an existing request processing interface. | 40 // These interfaces represent an existing request processing interface. |
| 37 // The idea is to imagine a real application that uses these interfaces | 41 // The idea is to imagine a real application that uses these interfaces |
| 38 // and then add scripting capabilities that allow you to interact with | 42 // and then add scripting capabilities that allow you to interact with |
| 39 // the objects through JavaScript. | 43 // the objects through JavaScript. |
| 40 | 44 |
| 41 /** | 45 /** |
| 42 * A simplified http request. | 46 * A simplified http request. |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 JsHttpRequestProcessor processor(source); | 615 JsHttpRequestProcessor processor(source); |
| 612 map<string, string> output; | 616 map<string, string> output; |
| 613 if (!processor.Initialize(&options, &output)) { | 617 if (!processor.Initialize(&options, &output)) { |
| 614 fprintf(stderr, "Error initializing processor.\n"); | 618 fprintf(stderr, "Error initializing processor.\n"); |
| 615 return 1; | 619 return 1; |
| 616 } | 620 } |
| 617 if (!ProcessEntries(&processor, kSampleSize, kSampleRequests)) | 621 if (!ProcessEntries(&processor, kSampleSize, kSampleRequests)) |
| 618 return 1; | 622 return 1; |
| 619 PrintMap(&output); | 623 PrintMap(&output); |
| 620 } | 624 } |
| OLD | NEW |