| 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 } | 406 } |
| 407 | 407 |
| 408 int Get_Block(void* param, unsigned long pos, unsigned char* pBuf, | 408 int Get_Block(void* param, unsigned long pos, unsigned char* pBuf, |
| 409 unsigned long size) { | 409 unsigned long size) { |
| 410 TestLoader* pLoader = (TestLoader*) param; | 410 TestLoader* pLoader = (TestLoader*) param; |
| 411 if (pos + size < pos || pos + size > pLoader->m_Len) return 0; | 411 if (pos + size < pos || pos + size > pLoader->m_Len) return 0; |
| 412 memcpy(pBuf, pLoader->m_pBuf + pos, size); | 412 memcpy(pBuf, pLoader->m_pBuf + pos, size); |
| 413 return 1; | 413 return 1; |
| 414 } | 414 } |
| 415 | 415 |
| 416 bool Is_Data_Avail(FX_FILEAVAIL* pThis, size_t offset, size_t size) { | 416 FPDF_BOOL Is_Data_Avail(FX_FILEAVAIL* pThis, size_t offset, size_t size) { |
| 417 return true; | 417 return true; |
| 418 } | 418 } |
| 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 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 RenderPdf(filename, file_contents, file_length, options); | 613 RenderPdf(filename, file_contents, file_length, options); |
| 614 free(file_contents); | 614 free(file_contents); |
| 615 } | 615 } |
| 616 | 616 |
| 617 FPDF_DestroyLibrary(); | 617 FPDF_DestroyLibrary(); |
| 618 v8::V8::ShutdownPlatform(); | 618 v8::V8::ShutdownPlatform(); |
| 619 delete platform; | 619 delete platform; |
| 620 | 620 |
| 621 return 0; | 621 return 0; |
| 622 } | 622 } |
| OLD | NEW |