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 | |
585 // By enabling predicatble mode, V8 won't post any background tasks. | 586 // By enabling predicatble mode, V8 won't post any background tasks. |
Lei Zhang
2015/06/02 22:17:05
typo, btw
| |
586 const char predictable_flag[] = "--predictable"; | 587 static const char predictable_flag[] = "--predictable"; |
587 v8::V8::SetFlagsFromString(predictable_flag, strlen(predictable_flag)); | 588 v8::V8::SetFlagsFromString(predictable_flag, sizeof(predictable_flag) - 1); |
Lei Zhang
2015/06/02 22:17:05
Sigh, why are they taking an int for a string leng
| |
588 | 589 |
589 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 590 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
590 v8::StartupData natives; | 591 v8::StartupData natives; |
591 v8::StartupData snapshot; | 592 v8::StartupData snapshot; |
592 if (!GetExternalData(options, "natives_blob.bin", &natives) || | 593 if (!GetExternalData(options, "natives_blob.bin", &natives) || |
593 !GetExternalData(options, "snapshot_blob.bin", &snapshot)) { | 594 !GetExternalData(options, "snapshot_blob.bin", &snapshot)) { |
594 return 1; | 595 return 1; |
595 } | 596 } |
596 v8::V8::SetNativesDataBlob(&natives); | 597 v8::V8::SetNativesDataBlob(&natives); |
597 v8::V8::SetSnapshotDataBlob(&snapshot); | 598 v8::V8::SetSnapshotDataBlob(&snapshot); |
(...skipping 18 matching lines...) Expand all Loading... | |
616 RenderPdf(filename, file_contents, file_length, options); | 617 RenderPdf(filename, file_contents, file_length, options); |
617 free(file_contents); | 618 free(file_contents); |
618 } | 619 } |
619 | 620 |
620 FPDF_DestroyLibrary(); | 621 FPDF_DestroyLibrary(); |
621 v8::V8::ShutdownPlatform(); | 622 v8::V8::ShutdownPlatform(); |
622 delete platform; | 623 delete platform; |
623 | 624 |
624 return 0; | 625 return 0; |
625 } | 626 } |
OLD | NEW |