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

Side by Side Diff: samples/pdfium_test.cc

Issue 1157123003: Run V8 in predictable mode for pdfium_test (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: updates Created 5 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 | « no previous file | testing/embedder_test.cpp » ('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 (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
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.
586 const char predictable_flag[] = "--predictable";
587 v8::V8::SetFlagsFromString(predictable_flag, strlen(predictable_flag));
585 588
586 #ifdef V8_USE_EXTERNAL_STARTUP_DATA 589 #ifdef V8_USE_EXTERNAL_STARTUP_DATA
587 v8::StartupData natives; 590 v8::StartupData natives;
588 v8::StartupData snapshot; 591 v8::StartupData snapshot;
589 if (!GetExternalData(options, "natives_blob.bin", &natives) || 592 if (!GetExternalData(options, "natives_blob.bin", &natives) ||
590 !GetExternalData(options, "snapshot_blob.bin", &snapshot)) { 593 !GetExternalData(options, "snapshot_blob.bin", &snapshot)) {
591 return 1; 594 return 1;
592 } 595 }
593 v8::V8::SetNativesDataBlob(&natives); 596 v8::V8::SetNativesDataBlob(&natives);
594 v8::V8::SetSnapshotDataBlob(&snapshot); 597 v8::V8::SetSnapshotDataBlob(&snapshot);
(...skipping 18 matching lines...) Expand all
613 RenderPdf(filename, file_contents, file_length, options); 616 RenderPdf(filename, file_contents, file_length, options);
614 free(file_contents); 617 free(file_contents);
615 } 618 }
616 619
617 FPDF_DestroyLibrary(); 620 FPDF_DestroyLibrary();
618 v8::V8::ShutdownPlatform(); 621 v8::V8::ShutdownPlatform();
619 delete platform; 622 delete platform;
620 623
621 return 0; 624 return 0;
622 } 625 }
OLDNEW
« no previous file with comments | « no previous file | testing/embedder_test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698