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

Side by Side Diff: samples/pdfium_test.cc

Issue 1263963002: Merge to XFA: Plumb in an externally created v8::Isolate (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 4 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 | « public/fpdf_formfill.h ('k') | 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 #include <wchar.h> 9 #include <wchar.h>
10 10
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 420
421 void Add_Segment(FX_DOWNLOADHINTS* pThis, size_t offset, size_t size) { 421 void Add_Segment(FX_DOWNLOADHINTS* pThis, size_t offset, size_t size) {
422 } 422 }
423 423
424 void RenderPdf(const std::string& name, const char* pBuf, size_t len, 424 void RenderPdf(const std::string& name, const char* pBuf, size_t len,
425 const Options& options) { 425 const Options& options) {
426 fprintf(stderr, "Rendering PDF file %s.\n", name.c_str()); 426 fprintf(stderr, "Rendering PDF file %s.\n", name.c_str());
427 427
428 IPDF_JSPLATFORM platform_callbacks; 428 IPDF_JSPLATFORM platform_callbacks;
429 memset(&platform_callbacks, '\0', sizeof(platform_callbacks)); 429 memset(&platform_callbacks, '\0', sizeof(platform_callbacks));
430 platform_callbacks.version = 1; 430 platform_callbacks.version = 2;
431 platform_callbacks.app_alert = ExampleAppAlert; 431 platform_callbacks.app_alert = ExampleAppAlert;
432 platform_callbacks.Doc_gotoPage = ExampleDocGotoPage; 432 platform_callbacks.Doc_gotoPage = ExampleDocGotoPage;
433 433
434 FPDF_FORMFILLINFO form_callbacks; 434 FPDF_FORMFILLINFO form_callbacks;
435 memset(&form_callbacks, '\0', sizeof(form_callbacks)); 435 memset(&form_callbacks, '\0', sizeof(form_callbacks));
436 form_callbacks.version = 2; 436 form_callbacks.version = 2;
437 form_callbacks.m_pJsPlatform = &platform_callbacks; 437 form_callbacks.m_pJsPlatform = &platform_callbacks;
438 438
439 TestLoader loader(pBuf, len); 439 TestLoader loader(pBuf, len);
440 440
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 RenderPdf(filename, file_contents, file_length, options); 631 RenderPdf(filename, file_contents, file_length, options);
632 free(file_contents); 632 free(file_contents);
633 } 633 }
634 634
635 FPDF_DestroyLibrary(); 635 FPDF_DestroyLibrary();
636 v8::V8::ShutdownPlatform(); 636 v8::V8::ShutdownPlatform();
637 delete platform; 637 delete platform;
638 638
639 return 0; 639 return 0;
640 } 640 }
OLDNEW
« no previous file with comments | « public/fpdf_formfill.h ('k') | testing/embedder_test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698