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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 | 419 |
420 void Add_Segment(FX_DOWNLOADHINTS* pThis, size_t offset, size_t size) { | 420 void Add_Segment(FX_DOWNLOADHINTS* pThis, size_t offset, size_t size) { |
421 } | 421 } |
422 | 422 |
423 void RenderPdf(const std::string& name, const char* pBuf, size_t len, | 423 void RenderPdf(const std::string& name, const char* pBuf, size_t len, |
424 const Options& options) { | 424 const Options& options) { |
425 fprintf(stderr, "Rendering PDF file %s.\n", name.c_str()); | 425 fprintf(stderr, "Rendering PDF file %s.\n", name.c_str()); |
426 | 426 |
427 IPDF_JSPLATFORM platform_callbacks; | 427 IPDF_JSPLATFORM platform_callbacks; |
428 memset(&platform_callbacks, '\0', sizeof(platform_callbacks)); | 428 memset(&platform_callbacks, '\0', sizeof(platform_callbacks)); |
429 platform_callbacks.version = 1; | 429 platform_callbacks.version = 2; |
430 platform_callbacks.app_alert = ExampleAppAlert; | 430 platform_callbacks.app_alert = ExampleAppAlert; |
431 platform_callbacks.Doc_gotoPage = ExampleDocGotoPage; | 431 platform_callbacks.Doc_gotoPage = ExampleDocGotoPage; |
432 | 432 |
433 FPDF_FORMFILLINFO form_callbacks; | 433 FPDF_FORMFILLINFO form_callbacks; |
434 memset(&form_callbacks, '\0', sizeof(form_callbacks)); | 434 memset(&form_callbacks, '\0', sizeof(form_callbacks)); |
435 form_callbacks.version = 1; | 435 form_callbacks.version = 1; |
436 form_callbacks.m_pJsPlatform = &platform_callbacks; | 436 form_callbacks.m_pJsPlatform = &platform_callbacks; |
437 | 437 |
438 TestLoader loader(pBuf, len); | 438 TestLoader loader(pBuf, len); |
439 | 439 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 continue; | 620 continue; |
621 free(file_contents); | 621 free(file_contents); |
622 } | 622 } |
623 | 623 |
624 FPDF_DestroyLibrary(); | 624 FPDF_DestroyLibrary(); |
625 v8::V8::ShutdownPlatform(); | 625 v8::V8::ShutdownPlatform(); |
626 delete platform; | 626 delete platform; |
627 | 627 |
628 return 0; | 628 return 0; |
629 } | 629 } |
OLD | NEW |