OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef GIN_V8_INITIALIZER_H_ | 5 #ifndef GIN_V8_INITIALIZER_H_ |
6 #define GIN_V8_INITIALIZER_H_ | 6 #define GIN_V8_INITIALIZER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 static void Initialize(IsolateHolder::ScriptMode mode, | 23 static void Initialize(IsolateHolder::ScriptMode mode, |
24 IsolateHolder::V8ExtrasMode v8_extras_mode); | 24 IsolateHolder::V8ExtrasMode v8_extras_mode); |
25 | 25 |
26 // Get address and size information for currently loaded snapshot. | 26 // Get address and size information for currently loaded snapshot. |
27 // If no snapshot is loaded, the return values are null for addresses | 27 // If no snapshot is loaded, the return values are null for addresses |
28 // and 0 for sizes. | 28 // and 0 for sizes. |
29 static void GetV8ExternalSnapshotData(const char** natives_data_out, | 29 static void GetV8ExternalSnapshotData(const char** natives_data_out, |
30 int* natives_size_out, | 30 int* natives_size_out, |
31 const char** snapshot_data_out, | 31 const char** snapshot_data_out, |
32 int* snapshot_size_out); | 32 int* snapshot_size_out); |
| 33 static void GetV8ContextData(const char** snapshot_data_out, |
| 34 int* snapshot_size_out); |
33 | 35 |
34 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) | 36 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) |
35 | 37 |
36 // Load V8 snapshot from user provided platform file descriptors. | 38 // Load V8 snapshot from user provided platform file descriptors. |
37 // The offset and size arguments, if non-zero, specify the portions | 39 // The offset and size arguments, if non-zero, specify the portions |
38 // of the files to be loaded. Since the VM can boot with or without | 40 // of the files to be loaded. Since the VM can boot with or without |
39 // the snapshot, this function does not return a status. | 41 // the snapshot, this function does not return a status. |
40 static void LoadV8SnapshotFromFD(base::PlatformFile snapshot_fd, | 42 static void LoadV8SnapshotFromFD(base::PlatformFile snapshot_fd, |
41 int64_t snapshot_offset, | 43 int64_t snapshot_offset, |
42 int64_t snapshot_size); | 44 int64_t snapshot_size); |
(...skipping 26 matching lines...) Expand all Loading... |
69 #if defined(OS_ANDROID) | 71 #if defined(OS_ANDROID) |
70 static base::PlatformFile GetOpenSnapshotFileForChildProcesses( | 72 static base::PlatformFile GetOpenSnapshotFileForChildProcesses( |
71 base::MemoryMappedFile::Region* region_out, | 73 base::MemoryMappedFile::Region* region_out, |
72 bool abi_32_bit); | 74 bool abi_32_bit); |
73 | 75 |
74 static base::FilePath GetNativesFilePath(); | 76 static base::FilePath GetNativesFilePath(); |
75 static base::FilePath GetSnapshotFilePath(bool abi_32_bit); | 77 static base::FilePath GetSnapshotFilePath(bool abi_32_bit); |
76 #endif | 78 #endif |
77 | 79 |
78 #endif // V8_USE_EXTERNAL_STARTUP_DATA | 80 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| 81 |
| 82 static void LoadV8ContextFromFD(base::PlatformFile snapshot_fd, |
| 83 int64_t snapshot_offset, |
| 84 int64_t snapshot_size); |
| 85 static void LoadV8Context(); |
| 86 static base::PlatformFile GetOpenV8ContextFileForChildProcesses( |
| 87 base::MemoryMappedFile::Region* region_out); |
| 88 #if defined(OS_ANDROID) |
| 89 static base::FilePath GetV8ContextFilePath(); |
| 90 #endif |
79 }; | 91 }; |
80 | 92 |
81 } // namespace gin | 93 } // namespace gin |
82 | 94 |
83 #endif // GIN_V8_INITIALIZER_H_ | 95 #endif // GIN_V8_INITIALIZER_H_ |
OLD | NEW |