summaryrefslogtreecommitdiffstats
path: root/gin
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 15:02:06 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 15:02:06 +0000
commitff1554e8f3f5cfcabbcf89aedf740f070216e24e (patch)
treed9b67874fb419de09e7e558b724d77b449648098 /gin
parenta91edfaaa40c863946aafac4b450a122e038e33c (diff)
downloadchromium_src-ff1554e8f3f5cfcabbcf89aedf740f070216e24e.zip
chromium_src-ff1554e8f3f5cfcabbcf89aedf740f070216e24e.tar.gz
chromium_src-ff1554e8f3f5cfcabbcf89aedf740f070216e24e.tar.bz2
Reland 240298 "[gin] also install gin function templates on non-...""
> [gin] also install gin function templates on non-gin managed > isolates > > BUG=321631 > R=dcarney@chromium.org > > Review URL: https://codereview.chromium.org/110443005 BUG=321631 R=aa@chromium.org Review URL: https://codereview.chromium.org/108173009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240651 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gin')
-rw-r--r--gin/isolate_holder.cc16
-rw-r--r--gin/public/isolate_holder.h2
2 files changed, 11 insertions, 7 deletions
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
index 1ddbe78..1929ebd 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -53,19 +53,14 @@ IsolateHolder::IsolateHolder()
constraints.ConfigureDefaults(base::SysInfo::AmountOfPhysicalMemory(),
base::SysInfo::NumberOfProcessors());
v8::SetResourceConstraints(isolate_, &constraints);
- v8::Isolate::Scope isolate_scope(isolate_);
- v8::HandleScope handle_scope(isolate_);
- isolate_data_.reset(new PerIsolateData(isolate_));
- InitFunctionTemplates(isolate_data_.get());
+ Init();
}
IsolateHolder::IsolateHolder(v8::Isolate* isolate)
: isolate_owner_(false),
isolate_(isolate) {
EnsureV8Initialized(false);
- v8::Isolate::Scope isolate_scope(isolate_);
- v8::HandleScope handle_scope(isolate_);
- isolate_data_.reset(new PerIsolateData(isolate_));
+ Init();
}
IsolateHolder::~IsolateHolder() {
@@ -74,4 +69,11 @@ IsolateHolder::~IsolateHolder() {
isolate_->Dispose();
}
+void IsolateHolder::Init() {
+ v8::Isolate::Scope isolate_scope(isolate_);
+ v8::HandleScope handle_scope(isolate_);
+ isolate_data_.reset(new PerIsolateData(isolate_));
+ InitFunctionTemplates(isolate_data_.get());
+}
+
} // namespace gin
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h
index 0d0654e..d68e4d5 100644
--- a/gin/public/isolate_holder.h
+++ b/gin/public/isolate_holder.h
@@ -37,6 +37,8 @@ class GIN_EXPORT IsolateHolder {
v8::Isolate* isolate() { return isolate_; }
private:
+ void Init();
+
bool isolate_owner_;
v8::Isolate* isolate_;
scoped_ptr<PerIsolateData> isolate_data_;