OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <limits.h> | 5 #include <limits.h> |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 std::list<std::string> files; | 575 std::list<std::string> files; |
576 if (!ParseCommandLine(args, &options, &files)) { | 576 if (!ParseCommandLine(args, &options, &files)) { |
577 fprintf(stderr, "%s", usage_string); | 577 fprintf(stderr, "%s", usage_string); |
578 return 1; | 578 return 1; |
579 } | 579 } |
580 | 580 |
581 v8::V8::InitializeICU(); | 581 v8::V8::InitializeICU(); |
582 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); | 582 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); |
583 v8::V8::InitializePlatform(platform); | 583 v8::V8::InitializePlatform(platform); |
584 v8::V8::Initialize(); | 584 v8::V8::Initialize(); |
585 // By enabling predicatble mode, V8 won't post any background tasks. | 585 |
586 const char predictable_flag[] = "--predictable"; | 586 // By enabling predictable mode, V8 won't post any background tasks. |
587 v8::V8::SetFlagsFromString(predictable_flag, strlen(predictable_flag)); | 587 static const char predictable_flag[] = "--predictable"; |
| 588 v8::V8::SetFlagsFromString(predictable_flag, |
| 589 static_cast<int>(strlen(predictable_flag))); |
588 | 590 |
589 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 591 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
590 v8::StartupData natives; | 592 v8::StartupData natives; |
591 v8::StartupData snapshot; | 593 v8::StartupData snapshot; |
592 if (!GetExternalData(options, "natives_blob.bin", &natives) || | 594 if (!GetExternalData(options, "natives_blob.bin", &natives) || |
593 !GetExternalData(options, "snapshot_blob.bin", &snapshot)) { | 595 !GetExternalData(options, "snapshot_blob.bin", &snapshot)) { |
594 return 1; | 596 return 1; |
595 } | 597 } |
596 v8::V8::SetNativesDataBlob(&natives); | 598 v8::V8::SetNativesDataBlob(&natives); |
597 v8::V8::SetSnapshotDataBlob(&snapshot); | 599 v8::V8::SetSnapshotDataBlob(&snapshot); |
(...skipping 18 matching lines...) Expand all Loading... |
616 RenderPdf(filename, file_contents, file_length, options); | 618 RenderPdf(filename, file_contents, file_length, options); |
617 free(file_contents); | 619 free(file_contents); |
618 } | 620 } |
619 | 621 |
620 FPDF_DestroyLibrary(); | 622 FPDF_DestroyLibrary(); |
621 v8::V8::ShutdownPlatform(); | 623 v8::V8::ShutdownPlatform(); |
622 delete platform; | 624 delete platform; |
623 | 625 |
624 return 0; | 626 return 0; |
625 } | 627 } |
OLD | NEW |