| 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 "gin/array_buffer.h" | 9 #include "gin/array_buffer.h" |
| 10 #include "gin/gin_export.h" | 10 #include "gin/gin_export.h" |
| 11 #include "gin/public/isolate_holder.h" | 11 #include "gin/public/isolate_holder.h" |
| 12 #include "gin/public/v8_platform.h" | 12 #include "gin/public/v8_platform.h" |
| 13 #include "v8/include/v8.h" | 13 #include "v8/include/v8.h" |
| 14 | 14 |
| 15 namespace gin { | 15 namespace gin { |
| 16 | 16 |
| 17 class GIN_EXPORT V8Initializer { | 17 class GIN_EXPORT V8Initializer { |
| 18 public: | 18 public: |
| 19 static const int kV8SnapshotBasePathKey; | |
| 20 static const char kNativesFileName[]; | |
| 21 static const char kSnapshotFileName[]; | |
| 22 | |
| 23 // This should be called by IsolateHolder::Initialize(). | 19 // This should be called by IsolateHolder::Initialize(). |
| 24 static void Initialize(gin::IsolateHolder::ScriptMode mode); | 20 static void Initialize(gin::IsolateHolder::ScriptMode mode); |
| 25 | 21 |
| 26 // Get address and size information for currently loaded snapshot. | 22 // Get address and size information for currently loaded snapshot. |
| 27 // If no snapshot is loaded, the return values are null for addresses | 23 // If no snapshot is loaded, the return values are null for addresses |
| 28 // and 0 for sizes. | 24 // and 0 for sizes. |
| 29 static void GetV8ExternalSnapshotData(const char** natives_data_out, | 25 static void GetV8ExternalSnapshotData(const char** natives_data_out, |
| 30 int* natives_size_out, | 26 int* natives_size_out, |
| 31 const char** snapshot_data_out, | 27 const char** snapshot_data_out, |
| 32 int* snapshot_size_out); | 28 int* snapshot_size_out); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 53 // child processes. | 49 // child processes. |
| 54 static bool OpenV8FilesForChildProcesses(base::PlatformFile* natives_fd_out, | 50 static bool OpenV8FilesForChildProcesses(base::PlatformFile* natives_fd_out, |
| 55 base::PlatformFile* snapshot_fd_out); | 51 base::PlatformFile* snapshot_fd_out); |
| 56 | 52 |
| 57 #endif // V8_USE_EXTERNAL_STARTUP_DATA | 53 #endif // V8_USE_EXTERNAL_STARTUP_DATA |
| 58 }; | 54 }; |
| 59 | 55 |
| 60 } // namespace gin | 56 } // namespace gin |
| 61 | 57 |
| 62 #endif // GIN_V8_INITIALIZER_H_ | 58 #endif // GIN_V8_INITIALIZER_H_ |
| OLD | NEW |