Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: gin/v8_initializer.h

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: . Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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,
Yuki 2017/04/28 13:48:28 GetV8ContextSnapshotData?
peria 2017/06/01 08:33:31 Done.
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698