| 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 "base/files/file.h" | 8 #include "base/files/file.h" |
| 9 #include "base/files/memory_mapped_file.h" | 9 #include "base/files/memory_mapped_file.h" |
| 10 #include "gin/array_buffer.h" | 10 #include "gin/array_buffer.h" |
| 11 #include "gin/gin_export.h" | 11 #include "gin/gin_export.h" |
| 12 #include "gin/public/isolate_holder.h" | 12 #include "gin/public/isolate_holder.h" |
| 13 #include "gin/public/v8_platform.h" | 13 #include "gin/public/v8_platform.h" |
| 14 #include "v8/include/v8.h" | 14 #include "v8/include/v8.h" |
| 15 | 15 |
| 16 namespace gin { | 16 namespace gin { |
| 17 | 17 |
| 18 class GIN_EXPORT V8Initializer { | 18 class GIN_EXPORT V8Initializer { |
| 19 public: | 19 public: |
| 20 // This should be called by IsolateHolder::Initialize(). | 20 // This should be called by IsolateHolder::Initialize(). |
| 21 static void Initialize(gin::IsolateHolder::ScriptMode mode); | 21 static void Initialize(IsolateHolder::ScriptMode mode, |
| 22 IsolateHolder::V8ExtrasMode v8_extras_mode); |
| 22 | 23 |
| 23 // Get address and size information for currently loaded snapshot. | 24 // Get address and size information for currently loaded snapshot. |
| 24 // If no snapshot is loaded, the return values are null for addresses | 25 // If no snapshot is loaded, the return values are null for addresses |
| 25 // and 0 for sizes. | 26 // and 0 for sizes. |
| 26 static void GetV8ExternalSnapshotData(const char** natives_data_out, | 27 static void GetV8ExternalSnapshotData(const char** natives_data_out, |
| 27 int* natives_size_out, | 28 int* natives_size_out, |
| 28 const char** snapshot_data_out, | 29 const char** snapshot_data_out, |
| 29 int* snapshot_size_out); | 30 int* snapshot_size_out); |
| 30 | 31 |
| 31 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) | 32 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 61 // Use with LoadV8SnapshotFromFD(). | 62 // Use with LoadV8SnapshotFromFD(). |
| 62 // Will return -1 if the file does not exist. | 63 // Will return -1 if the file does not exist. |
| 63 static base::PlatformFile GetOpenSnapshotFileForChildProcesses( | 64 static base::PlatformFile GetOpenSnapshotFileForChildProcesses( |
| 64 base::MemoryMappedFile::Region* region_out); | 65 base::MemoryMappedFile::Region* region_out); |
| 65 #endif // V8_USE_EXTERNAL_STARTUP_DATA | 66 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 } // namespace gin | 69 } // namespace gin |
| 69 | 70 |
| 70 #endif // GIN_V8_INITIALIZER_H_ | 71 #endif // GIN_V8_INITIALIZER_H_ |
| OLD | NEW |