diff options
author | oth <oth@chromium.org> | 2015-04-05 07:30:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-05 14:31:16 +0000 |
commit | 05c26fde422600a25247a22f9670463216d0519a (patch) | |
tree | a2443f512888c10b64f892b4f78f200d18c4575d /gin/test | |
parent | f13b7592e312f69e70062fbcf72b746eefaf13fc (diff) | |
download | chromium_src-05c26fde422600a25247a22f9670463216d0519a.zip chromium_src-05c26fde422600a25247a22f9670463216d0519a.tar.gz chromium_src-05c26fde422600a25247a22f9670463216d0519a.tar.bz2 |
Move V8 snapshot loading code from isolate_holder to gin/v8_startup_data.{h,cc}.
isolate_holder.h is public and used by blink and therefore cannot refer to types from base. As part of porting this to other platforms we needed to load snapshots from BaseFile descriptors.
BUG=421063
Review URL: https://codereview.chromium.org/1011133006
Cr-Commit-Position: refs/heads/master@{#323886}
Diffstat (limited to 'gin/test')
-rw-r--r-- | gin/test/file_runner.cc | 8 | ||||
-rw-r--r-- | gin/test/v8_test.cc | 8 |
2 files changed, 6 insertions, 10 deletions
diff --git a/gin/test/file_runner.cc b/gin/test/file_runner.cc index b639d06..723ab98 100644 --- a/gin/test/file_runner.cc +++ b/gin/test/file_runner.cc @@ -17,12 +17,9 @@ #include "gin/test/gc.h" #include "gin/test/gtest.h" #include "gin/try_catch.h" +#include "gin/v8_initializer.h" #include "testing/gtest/include/gtest/gtest.h" -#ifdef V8_USE_EXTERNAL_STARTUP_DATA -#include "gin/public/isolate_holder.h" -#endif - namespace gin { namespace { @@ -63,11 +60,12 @@ void RunTestFromFile(const base::FilePath& path, FileRunnerDelegate* delegate, base::MessageLoop message_loop; #ifdef V8_USE_EXTERNAL_STARTUP_DATA - gin::IsolateHolder::LoadV8Snapshot(); + gin::V8Initializer::LoadV8Snapshot(); #endif gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode, gin::ArrayBufferAllocator::SharedInstance()); + gin::IsolateHolder instance; gin::ShellRunner runner(delegate, instance.isolate()); { diff --git a/gin/test/v8_test.cc b/gin/test/v8_test.cc index a022511..aad291d 100644 --- a/gin/test/v8_test.cc +++ b/gin/test/v8_test.cc @@ -6,10 +6,7 @@ #include "gin/array_buffer.h" #include "gin/public/isolate_holder.h" - -#ifdef V8_USE_EXTERNAL_STARTUP_DATA -#include "gin/public/isolate_holder.h" -#endif +#include "gin/v8_initializer.h" using v8::Context; using v8::Local; @@ -25,10 +22,11 @@ V8Test::~V8Test() { void V8Test::SetUp() { #ifdef V8_USE_EXTERNAL_STARTUP_DATA - gin::IsolateHolder::LoadV8Snapshot(); + gin::V8Initializer::LoadV8Snapshot(); #endif gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode, gin::ArrayBufferAllocator::SharedInstance()); + instance_.reset(new gin::IsolateHolder); instance_->isolate()->Enter(); HandleScope handle_scope(instance_->isolate()); |