diff options
author | Andrei Popescu <andreip@google.com> | 2010-03-29 12:03:09 +0100 |
---|---|---|
committer | Andrei Popescu <andreip@google.com> | 2010-03-29 12:03:09 +0100 |
commit | 74b3c146906ea120f97974b0e16aec75c17ebf66 (patch) | |
tree | 529f5893bf30271b7123fa94822c28131bd3bda1 /src/api.cc | |
parent | 144045c95df339bcbcf35374401289e1eefc1d85 (diff) | |
download | android_external_v8-74b3c146906ea120f97974b0e16aec75c17ebf66.tar.gz android_external_v8-74b3c146906ea120f97974b0e16aec75c17ebf66.tar.bz2 android_external_v8-74b3c146906ea120f97974b0e16aec75c17ebf66.zip |
Cherry pick http://codereview.chromium.org/1207003/show
Implement support for reattaching a global object to a context. This
can be used to use the same global object for different contexts at
different points in time.
Needed to fix b: 2533219
Change-Id: Ib3b0d35f6ce3e0a5f4b8e54561ba2e99a9ab0ab1
Diffstat (limited to 'src/api.cc')
-rw-r--r-- | src/api.cc | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -3007,6 +3007,16 @@ void Context::DetachGlobal() { } +void Context::ReattachGlobal(Handle<Object> global_object) { + if (IsDeadCheck("v8::Context::ReattachGlobal()")) return; + ENTER_V8; + i::Object** ctx = reinterpret_cast<i::Object**>(this); + i::Handle<i::Context> context = + i::Handle<i::Context>::cast(i::Handle<i::Object>(ctx)); + i::Bootstrapper::ReattachGlobal(context, Utils::OpenHandle(*global_object)); +} + + Local<v8::Object> ObjectTemplate::NewInstance() { ON_BAILOUT("v8::ObjectTemplate::NewInstance()", return Local<v8::Object>()); LOG_API("ObjectTemplate::NewInstance"); |