Chromium Code Reviews| Index: gin/public/isolate_holder.h |
| diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h |
| index 29cc2083334b356d9caff02a5b75abc9bc562b49..19a8d3893604f0a0e7a47970d0ebb2230ad587a6 100644 |
| --- a/gin/public/isolate_holder.h |
| +++ b/gin/public/isolate_holder.h |
| @@ -10,6 +10,10 @@ |
| #include "gin/gin_export.h" |
| #include "v8/include/v8.h" |
| +#ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| +#include "base/files/file_path.h" |
| +#endif |
| + |
| namespace gin { |
| class PerIsolateData; |
| @@ -31,7 +35,9 @@ class GIN_EXPORT IsolateHolder { |
| ~IsolateHolder(); |
| // Should be invoked once before creating IsolateHolder instances to |
| - // initialize V8 and Gin. |
| + // initialize V8 and Gin. In case V8_USE_EXTERNAL_STARTUP_DATA is defined, |
| + // V8's initial snapshot should be loaded (by calling LoadV8Snapshot or |
| + // LoadV8SnapshotFD) before calling Initialize. |
| static void Initialize(ScriptMode mode, |
| v8::ArrayBuffer::Allocator* allocator); |
| @@ -49,11 +55,26 @@ class GIN_EXPORT IsolateHolder { |
| // thread. |
| void RemoveRunMicrotasksObserver(); |
| +#ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| +#ifdef OS_ANDROID |
| + static bool LoadV8SnapshotFD(int natives_fd, int snapshot_fd); |
| +#endif |
| + static bool LoadV8Snapshot(); |
| +#endif // V8_USE_EXTERNAL_STARTUP_DATA |
| + |
| private: |
| v8::Isolate* isolate_; |
| scoped_ptr<PerIsolateData> isolate_data_; |
| scoped_ptr<RunMicrotasksObserver> task_observer_; |
| +#ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| + |
| + static bool MapV8Files( |
|
jochen (gone - plz use gerrit)
2014/10/08 15:16:05
this method can be in an anonymous namespace in is
baixo
2014/10/14 16:36:42
Done.
|
| + base::FilePath* natives_path, base::FilePath* snapshot_path, |
| + int natives = -1, int snapshot = -1); |
| + |
| +#endif // V8_USE_EXTERNAL_STARTUP_DATA |
| + |
| DISALLOW_COPY_AND_ASSIGN(IsolateHolder); |
| }; |