| 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 #include <wchar.h> | 9 #include <wchar.h> |
| 10 | 10 |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |