OLD | NEW |
1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 2015 PDFium 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 "test_support.h" | 5 #include "test_support.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #ifdef _WIN32 | 10 #ifdef _WIN32 |
11 #define PATH_SEPARATOR '\\' | 11 #define PATH_SEPARATOR '\\' |
12 #else | 12 #else |
13 #define PATH_SEPARATOR '/' | 13 #define PATH_SEPARATOR '/' |
14 #endif | 14 #endif |
15 | 15 |
| 16 #ifdef PDF_ENABLE_V8 |
| 17 #include "v8/include/libplatform/libplatform.h" |
| 18 #endif |
| 19 |
16 namespace { | 20 namespace { |
17 | 21 |
18 #ifdef PDF_ENABLE_V8 | 22 #ifdef PDF_ENABLE_V8 |
19 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 23 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
20 // Returns the full path for an external V8 data file based on either | 24 // Returns the full path for an external V8 data file based on either |
21 // the currect exectuable path or an explicit override. | 25 // the currect exectuable path or an explicit override. |
22 std::string GetFullPathForSnapshotFile(const std::string& exe_path, | 26 std::string GetFullPathForSnapshotFile(const std::string& exe_path, |
23 const std::string& bin_dir, | 27 const std::string& bin_dir, |
24 const std::string& filename) { | 28 const std::string& filename) { |
25 std::string result; | 29 std::string result; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 unsigned long pos, | 151 unsigned long pos, |
148 unsigned char* pBuf, | 152 unsigned char* pBuf, |
149 unsigned long size) { | 153 unsigned long size) { |
150 TestLoader* pLoader = static_cast<TestLoader*>(param); | 154 TestLoader* pLoader = static_cast<TestLoader*>(param); |
151 if (pos + size < pos || pos + size > pLoader->m_Len) | 155 if (pos + size < pos || pos + size > pLoader->m_Len) |
152 return 0; | 156 return 0; |
153 | 157 |
154 memcpy(pBuf, pLoader->m_pBuf + pos, size); | 158 memcpy(pBuf, pLoader->m_pBuf + pos, size); |
155 return 1; | 159 return 1; |
156 } | 160 } |
OLD | NEW |