Changeset 142250 in webkit
- Timestamp:
- Feb 8, 2013 2:17:15 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r142248 r142250 1 2013-02-08 Dan Carney <dcarney@google.com> 2 3 [v8] isolate parameter added to all v8::peristent calls 4 https://bugs.webkit.org/show_bug.cgi?id=109268 5 6 Reviewed by Kentaro Hara. 7 8 No new tests. No change in functionality. 9 10 * bindings/scripts/CodeGeneratorV8.pm: 11 (GenerateDomainSafeFunctionGetter): 12 (GenerateNamedConstructorCallback): 13 (GenerateImplementation): 14 * bindings/scripts/test/V8/V8Float64Array.cpp: 15 (WebCore::V8Float64Array::GetRawTemplate): 16 * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: 17 (WebCore::TestActiveDOMObjectV8Internal::postMessageAttrGetter): 18 (WebCore::V8TestActiveDOMObject::GetRawTemplate): 19 * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: 20 (WebCore::V8TestCustomNamedGetter::GetRawTemplate): 21 * bindings/scripts/test/V8/V8TestEventConstructor.cpp: 22 (WebCore::V8TestEventConstructor::GetRawTemplate): 23 * bindings/scripts/test/V8/V8TestEventTarget.cpp: 24 (WebCore::V8TestEventTarget::GetRawTemplate): 25 * bindings/scripts/test/V8/V8TestException.cpp: 26 (WebCore::V8TestException::GetRawTemplate): 27 * bindings/scripts/test/V8/V8TestInterface.cpp: 28 (WebCore::V8TestInterface::GetRawTemplate): 29 * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: 30 (WebCore::V8TestMediaQueryListListener::GetRawTemplate): 31 * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: 32 (WebCore::V8TestNamedConstructorConstructor::GetTemplate): 33 (WebCore::V8TestNamedConstructor::GetRawTemplate): 34 * bindings/scripts/test/V8/V8TestNode.cpp: 35 (WebCore::V8TestNode::GetRawTemplate): 36 * bindings/scripts/test/V8/V8TestObj.cpp: 37 (WebCore::V8TestObj::GetRawTemplate): 38 * bindings/scripts/test/V8/V8TestOverloadedConstructors.cpp: 39 (WebCore::V8TestOverloadedConstructors::GetRawTemplate): 40 * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: 41 (WebCore::V8TestSerializedScriptValueInterface::GetRawTemplate): 42 * bindings/v8/DOMWrapperMap.h: 43 (WebCore::DOMWrapperMap::clear): 44 * bindings/v8/DOMWrapperWorld.cpp: 45 (WebCore::isolatedWorldWeakCallback): 46 (WebCore::DOMWrapperWorld::makeContextWeak): 47 * bindings/v8/NPV8Object.cpp: 48 (WebCore::freeV8NPObject): 49 (WebCore::npCreateV8ScriptObject): 50 * bindings/v8/ScheduledAction.cpp: 51 (WebCore::ScheduledAction::ScheduledAction): 52 (WebCore::ScheduledAction::~ScheduledAction): 53 * bindings/v8/ScopedPersistent.h: 54 (WebCore::ScopedPersistent::ScopedPersistent): 55 (WebCore::ScopedPersistent::set): 56 (WebCore::ScopedPersistent::clear): 57 * bindings/v8/ScriptWrappable.h: 58 (WebCore::ScriptWrappable::setWrapper): 59 (WebCore::ScriptWrappable::disposeWrapper): 60 (WebCore::ScriptWrappable::weakCallback): 61 * bindings/v8/V8Binding.cpp: 62 (WebCore::createRawTemplate): 63 * bindings/v8/V8Binding.h: 64 (WebCore): 65 * bindings/v8/V8GCController.cpp: 66 (WebCore::gcTree): 67 (WebCore::V8GCController::gcPrologue): 68 (WebCore::V8GCController::minorGCPrologue): 69 * bindings/v8/V8GCController.h: 70 (V8GCController): 71 * bindings/v8/V8HiddenPropertyName.cpp: 72 (WebCore::V8HiddenPropertyName::createString): 73 * bindings/v8/V8LazyEventListener.cpp: 74 (WebCore::V8LazyEventListener::prepareListenerObject): 75 * bindings/v8/V8NPObject.cpp: 76 (WebCore::V8NPTemplateMap::dispose): 77 (WebCore::npObjectGetProperty): 78 (WebCore::createV8ObjectForNPObject): 79 * bindings/v8/V8PerContextData.cpp: 80 (WebCore::V8PerContextData::dispose): 81 (WebCore::V8PerContextData::createWrapperFromCacheSlowCase): 82 (WebCore::V8PerContextData::constructorForTypeSlowCase): 83 * bindings/v8/V8ValueCache.cpp: 84 (WebCore::makeExternalString): 85 * bindings/v8/WrapperTypeInfo.h: 86 (WebCore::WrapperConfiguration::configureWrapper): 87 * bindings/v8/custom/V8HTMLDocumentCustom.cpp: 88 (WebCore::V8HTMLDocument::wrapInShadowObject): 89 * bindings/v8/custom/V8HTMLImageElementConstructor.cpp: 90 (WebCore::V8HTMLImageElementConstructor::GetTemplate): 91 * bindings/v8/custom/V8InjectedScriptManager.cpp: 92 (WebCore::WeakReferenceCallback): 93 (WebCore::createInjectedScriptHostV8Wrapper): 94 * bindings/v8/custom/V8LocationCustom.cpp: 95 (WebCore::V8Location::reloadAccessorGetter): 96 (WebCore::V8Location::replaceAccessorGetter): 97 (WebCore::V8Location::assignAccessorGetter): 98 1 99 2013-02-08 Kent Tamura <tkent@chromium.org> 2 100 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r142248 r142250 799 799 static v8::Handle<v8::Value> ${funcName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) 800 800 { 801 static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New( $newTemplateString);801 static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(info.GetIsolate(), $newTemplateString); 802 802 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${v8InterfaceName}::GetTemplate(info.GetIsolate())); 803 803 if (holder.IsEmpty()) { … … 808 808 ${interfaceName}* imp = ${v8InterfaceName}::toNative(holder); 809 809 if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) { 810 static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New( $newTemplateString);810 static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(info.GetIsolate(), $newTemplateString); 811 811 return sharedTemplate->GetFunction(); 812 812 } … … 2208 2208 result->Inherit(${v8InterfaceName}::GetTemplate(isolate)); 2209 2209 2210 cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New( result);2210 cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, result); 2211 2211 return cachedTemplate; 2212 2212 } … … 3105 3105 3106 3106 v8::HandleScope handleScope; 3107 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate( );3107 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate); 3108 3108 data->rawTemplateMap().add(&info, templ); 3109 3109 return templ; … … 3223 3223 static v8::Persistent<v8::ObjectTemplate> V8DOMWindowShadowObjectCache; 3224 3224 if (V8DOMWindowShadowObjectCache.IsEmpty()) { 3225 V8DOMWindowShadowObjectCache = v8::Persistent<v8::ObjectTemplate>::New( v8::ObjectTemplate::New());3225 V8DOMWindowShadowObjectCache = v8::Persistent<v8::ObjectTemplate>::New(isolate, v8::ObjectTemplate::New()); 3226 3226 ConfigureShadowObjectTemplate(V8DOMWindowShadowObjectCache, isolate); 3227 3227 } -
trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
r142159 r142250 141 141 142 142 v8::HandleScope handleScope; 143 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate( );143 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate); 144 144 data->rawTemplateMap().add(&info, templ); 145 145 return templ; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
r142159 r142250 93 93 static v8::Handle<v8::Value> postMessageAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) 94 94 { 95 static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New( v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::postMessageCallback, v8Undefined(), v8::Signature::New(V8TestActiveDOMObject::GetRawTemplate(info.GetIsolate()))));95 static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(info.GetIsolate(), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::postMessageCallback, v8Undefined(), v8::Signature::New(V8TestActiveDOMObject::GetRawTemplate(info.GetIsolate())))); 96 96 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestActiveDOMObject::GetTemplate(info.GetIsolate())); 97 97 if (holder.IsEmpty()) { … … 102 102 TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(holder); 103 103 if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) { 104 static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New( v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::postMessageCallback, v8Undefined(), v8::Signature::New(V8TestActiveDOMObject::GetRawTemplate(info.GetIsolate()))));104 static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(info.GetIsolate(), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::postMessageCallback, v8Undefined(), v8::Signature::New(V8TestActiveDOMObject::GetRawTemplate(info.GetIsolate())))); 105 105 return sharedTemplate->GetFunction(); 106 106 } … … 169 169 170 170 v8::HandleScope handleScope; 171 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate( );171 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate); 172 172 data->rawTemplateMap().add(&info, templ); 173 173 return templ; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp
r142159 r142250 107 107 108 108 v8::HandleScope handleScope; 109 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate( );109 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate); 110 110 data->rawTemplateMap().add(&info, templ); 111 111 return templ; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
r142159 r142250 139 139 140 140 v8::HandleScope handleScope; 141 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate( );141 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate); 142 142 data->rawTemplateMap().add(&info, templ); 143 143 return templ; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
r142159 r142250 168 168 169 169 v8::HandleScope handleScope; 170 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate( );170 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate); 171 171 data->rawTemplateMap().add(&info, templ); 172 172 return templ; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp
r142159 r142250 98 98 99 99 v8::HandleScope handleScope; 100 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate( );100 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate); 101 101 data->rawTemplateMap().add(&info, templ); 102 102 return templ; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
r142248 r142250 322 322 323 323 v8::HandleScope handleScope; 324 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate( );324 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate); 325 325 data->rawTemplateMap().add(&info, templ); 326 326 return templ; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
r142159 r142250 107 107 108 108 v8::HandleScope handleScope; 109 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate( );109 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate); 110 110 data->rawTemplateMap().add(&info, templ); 111 111 return templ; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
r142159 r142250 113 113 result->Inherit(V8TestNamedConstructor::GetTemplate(isolate)); 114 114 115 cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New( result);115 cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, result); 116 116 return cachedTemplate; 117 117 } … … 141 141 142 142 v8::HandleScope handleScope; 143 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate( );143 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate); 144 144 data->rawTemplateMap().add(&info, templ); 145 145 return templ; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp
r142159 r142250 105 105 106 106 v8::HandleScope handleScope; 107 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate( );107 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate); 108 108 data->rawTemplateMap().add(&info, templ); 109 109 return templ; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
r142217 r142250 2219 2219 2220 2220 v8::HandleScope handleScope; 2221 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate( );2221 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate); 2222 2222 data->rawTemplateMap().add(&info, templ); 2223 2223 return templ; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestOverloadedConstructors.cpp
r142159 r142250 162 162 163 163 v8::HandleScope handleScope; 164 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate( );164 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate); 165 165 data->rawTemplateMap().add(&info, templ); 166 166 return templ; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
r142248 r142250 279 279 280 280 v8::HandleScope handleScope; 281 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate( );281 v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate); 282 282 data->rawTemplateMap().add(&info, templ); 283 283 return templ; -
trunk/Source/WebCore/bindings/v8/DOMWrapperMap.h
r142159 r142250 71 71 v8::Persistent<v8::Object> wrapper = it->value; 72 72 toWrapperTypeInfo(wrapper)->derefObject(it->key); 73 wrapper.Dispose( );73 wrapper.Dispose(m_isolate); 74 74 wrapper.Clear(); 75 75 } -
trunk/Source/WebCore/bindings/v8/DOMWrapperWorld.cpp
r142209 r142250 76 76 static void isolatedWorldWeakCallback(v8::Isolate* isolate, v8::Persistent<v8::Value> object, void* parameter) 77 77 { 78 object.Dispose( );78 object.Dispose(isolate); 79 79 object.Clear(); 80 80 static_cast<DOMWrapperWorld*>(parameter)->deref(); … … 85 85 ASSERT(isIsolatedWorld()); 86 86 ASSERT(isolated(context) == this); 87 v8::Persistent<v8::Context>::New(context).MakeWeak(context->GetIsolate(), this, isolatedWorldWeakCallback); 87 v8::Isolate* isolate = context->GetIsolate(); 88 v8::Persistent<v8::Context>::New(isolate, context).MakeWeak(isolate, this, isolatedWorldWeakCallback); 88 89 // Matching deref is in weak callback. 89 90 this->ref(); -
trunk/Source/WebCore/bindings/v8/NPV8Object.cpp
r141946 r142250 93 93 } 94 94 } 95 v8NpObject->v8Object.Dispose( );95 v8NpObject->v8Object.Dispose(v8::Isolate::GetCurrent()); 96 96 v8NpObject->v8Object.Clear(); 97 97 free(v8NpObject); … … 167 167 } 168 168 V8NPObject* v8npObject = reinterpret_cast<V8NPObject*>(_NPN_CreateObject(npp, &V8NPObjectClass)); 169 v8npObject->v8Object = v8::Persistent<v8::Object>::New( object);169 v8npObject->v8Object = v8::Persistent<v8::Object>::New(v8::Isolate::GetCurrent(), object); 170 170 v8npObject->rootObject = root; 171 171 -
trunk/Source/WebCore/bindings/v8/ScheduledAction.cpp
r135806 r142250 55 55 , m_code(String(), KURL(), TextPosition::belowRangePosition()) 56 56 { 57 v8::Isolate* isolate = m_context->GetIsolate(); 57 58 m_args.reserveCapacity(argc); 58 59 for (int i = 0; i < argc; ++i) 59 m_args.append(v8::Persistent<v8::Value>::New( argv[i]));60 m_args.append(v8::Persistent<v8::Value>::New(isolate, argv[i])); 60 61 } 61 62 … … 63 64 { 64 65 for (size_t i = 0; i < m_args.size(); ++i) { 65 m_args[i].Dispose( );66 m_args[i].Dispose(m_context->GetIsolate()); 66 67 m_args[i].Clear(); 67 68 } -
trunk/Source/WebCore/bindings/v8/ScopedPersistent.h
r129984 r142250 44 44 45 45 explicit ScopedPersistent(v8::Handle<T> handle) 46 : m_handle(v8::Persistent<T>::New( handle))46 : m_handle(v8::Persistent<T>::New(v8::Isolate::GetCurrent(), handle)) 47 47 { 48 48 } … … 61 61 { 62 62 clear(); 63 m_handle = v8::Persistent<T>::New( handle);63 m_handle = v8::Persistent<T>::New(v8::Isolate::GetCurrent(), handle); 64 64 } 65 65 … … 75 75 if (m_handle.IsEmpty()) 76 76 return; 77 m_handle.Dispose( );77 m_handle.Dispose(v8::Isolate::GetCurrent()); 78 78 m_handle.Clear(); 79 79 } -
trunk/Source/WebCore/bindings/v8/ScriptWrappable.h
r142159 r142250 50 50 { 51 51 ASSERT(m_maskedWrapper.IsEmpty()); 52 v8::Persistent<v8::Object> persistent = v8::Persistent<v8::Object>::New( wrapper);52 v8::Persistent<v8::Object> persistent = v8::Persistent<v8::Object>::New(isolate, wrapper); 53 53 configuration.configureWrapper(persistent, isolate); 54 54 persistent.MakeWeak(isolate, this, weakCallback); … … 63 63 64 64 private: 65 inline void disposeWrapper(v8::Persistent<v8::Value> value )65 inline void disposeWrapper(v8::Persistent<v8::Value> value, v8::Isolate* isolate) 66 66 { 67 67 ASSERT(!m_maskedWrapper.IsEmpty()); 68 68 ASSERT(*value == maskOrUnmaskPointer(*m_maskedWrapper)); 69 value.Dispose( );69 value.Dispose(isolate); 70 70 m_maskedWrapper.Clear(); 71 71 } … … 86 86 v8::Persistent<v8::Object> wrapper = v8::Persistent<v8::Object>::Cast(value); 87 87 ASSERT(key->wrapper() == wrapper); 88 key->disposeWrapper(value );88 key->disposeWrapper(value, isolate); 89 89 90 90 // Note: |object| might not be equal to |key|, e.g., if ScriptWrappable isn't a left-most base class. -
trunk/Source/WebCore/bindings/v8/V8Binding.cpp
r141948 r142250 175 175 } 176 176 177 v8::Persistent<v8::FunctionTemplate> createRawTemplate( )177 v8::Persistent<v8::FunctionTemplate> createRawTemplate(v8::Isolate* isolate) 178 178 { 179 179 v8::HandleScope scope; 180 180 v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(V8ObjectConstructor::isValidConstructorMode); 181 return v8::Persistent<v8::FunctionTemplate>::New( result);181 return v8::Persistent<v8::FunctionTemplate>::New(isolate, result); 182 182 } 183 183 -
trunk/Source/WebCore/bindings/v8/V8Binding.h
r142103 r142250 422 422 } 423 423 424 v8::Persistent<v8::FunctionTemplate> createRawTemplate( );424 v8::Persistent<v8::FunctionTemplate> createRawTemplate(v8::Isolate*); 425 425 426 426 PassRefPtr<DOMStringList> toDOMStringList(v8::Handle<v8::Value>, v8::Isolate*); -
trunk/Source/WebCore/bindings/v8/V8GCController.cpp
r142103 r142250 196 196 ASSERT(V8DOMWrapper::maybeDOMWrapper(value)); 197 197 198 if (value.IsIndependent( ))198 if (value.IsIndependent(m_isolate)) 199 199 return; 200 200 … … 224 224 UNUSED_PARAM(m_isolate); 225 225 ASSERT(V8Node::HasInstance(wrapper, m_isolate)); 226 ASSERT(!wrapper.IsIndependent( ));226 ASSERT(!wrapper.IsIndependent(m_isolate)); 227 227 228 228 Node* node = static_cast<Node*>(object); … … 255 255 Vector<Node*>* V8GCController::m_edenNodes = 0; 256 256 257 static void gcTree( Node* startNode)257 static void gcTree(v8::Isolate* isolate, Node* startNode) 258 258 { 259 259 Vector<v8::Persistent<v8::Value>, initialNodeVectorSize> newSpaceWrappers; … … 300 300 // We report those wrappers to V8 as an object group. 301 301 for (size_t i = 0; i < newSpaceWrappers.size(); i++) 302 newSpaceWrappers[i].MarkPartiallyDependent( );302 newSpaceWrappers[i].MarkPartiallyDependent(isolate); 303 303 if (newSpaceWrappers.size() > 0) 304 304 v8::V8::AddObjectGroup(&newSpaceWrappers[0], newSpaceWrappers.size()); … … 327 327 void V8GCController::gcPrologue(v8::GCType type, v8::GCCallbackFlags flags) 328 328 { 329 // It would be nice if the GC callbacks passed the Isolate directly.... 330 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 329 331 if (type == v8::kGCTypeScavenge) 330 minorGCPrologue( );332 minorGCPrologue(isolate); 331 333 else if (type == v8::kGCTypeMarkSweepCompact) 332 334 majorGCPrologue(); … … 338 340 } 339 341 340 void V8GCController::minorGCPrologue( )342 void V8GCController::minorGCPrologue(v8::Isolate* isolate) 341 343 { 342 344 TRACE_EVENT_BEGIN0("v8", "GC"); … … 346 348 ASSERT(!m_edenNodes->at(i)->wrapper().IsEmpty()); 347 349 if (m_edenNodes->at(i)->isV8CollectableDuringMinorGC()) // This branch is just for performance. 348 gcTree( m_edenNodes->at(i));350 gcTree(isolate, m_edenNodes->at(i)); 349 351 } 350 352 } -
trunk/Source/WebCore/bindings/v8/V8GCController.h
r142103 r142250 43 43 static void gcPrologue(v8::GCType, v8::GCCallbackFlags); 44 44 static void gcEpilogue(v8::GCType, v8::GCCallbackFlags); 45 static void minorGCPrologue( );45 static void minorGCPrologue(v8::Isolate*); 46 46 static void minorGCEpilogue(); 47 47 static void majorGCPrologue(); -
trunk/Source/WebCore/bindings/v8/V8HiddenPropertyName.cpp
r142226 r142250 74 74 { 75 75 v8::HandleScope scope; 76 return v8::Persistent<v8::String>::New(v8:: String::NewSymbol(key));76 return v8::Persistent<v8::String>::New(v8::Isolate::GetCurrent(), v8::String::NewSymbol(key)); 77 77 } 78 78 -
trunk/Source/WebCore/bindings/v8/V8LazyEventListener.cpp
r141946 r142250 216 216 V8PerIsolateData::current()->lazyEventListenerToStringTemplate(); 217 217 if (toStringTemplate.IsEmpty()) 218 toStringTemplate = v8::Persistent<v8::FunctionTemplate>::New( v8::FunctionTemplate::New(V8LazyEventListenerToString));218 toStringTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8LazyEventListenerToString)); 219 219 v8::Local<v8::Function> toStringFunction; 220 220 if (!toStringTemplate.IsEmpty()) -
trunk/Source/WebCore/bindings/v8/V8NPObject.cpp
r142159 r142250 201 201 MapType::iterator it = m_map.find(key); 202 202 ASSERT(it != m_map.end()); 203 it->value.Dispose( );203 it->value.Dispose(m_isolate); 204 204 it->value.Clear(); 205 205 m_map.remove(it); … … 251 251 v8::Local<v8::FunctionTemplate> temp = v8::FunctionTemplate::New(); 252 252 temp->SetCallHandler(npObjectMethodHandler, key); 253 functionTemplate = v8::Persistent<v8::FunctionTemplate>::New( temp);253 functionTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, temp); 254 254 V8NPTemplateMap::sharedInstance(isolate).set(id, functionTemplate); 255 255 } … … 429 429 // pointer, and field 1 is the type. There should be an api function that returns unused type id. The same Wrapper type 430 430 // can be used by DOM bindings. 431 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 431 432 if (npObjectDesc.IsEmpty()) { 432 npObjectDesc = v8::Persistent<v8::FunctionTemplate>::New( v8::FunctionTemplate::New());433 npObjectDesc = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New()); 433 434 npObjectDesc->InstanceTemplate()->SetInternalFieldCount(npObjectInternalFieldCount); 434 435 npObjectDesc->InstanceTemplate()->SetNamedPropertyHandler(npObjectNamedPropertyGetter, npObjectNamedPropertySetter, npObjectQueryProperty, 0, npObjectNamedPropertyEnumerator); -
trunk/Source/WebCore/bindings/v8/V8PerContextData.cpp
r142061 r142250 40 40 { 41 41 v8::HandleScope handleScope; 42 v8::Isolate* isolate = m_context->GetIsolate(); 42 43 m_context->SetAlignedPointerInEmbedderData(v8ContextPerContextDataIndex, 0); 43 44 … … 46 47 for (; it != m_wrapperBoilerplates.end(); ++it) { 47 48 v8::Persistent<v8::Object> wrapper = it->value; 48 wrapper.Dispose( );49 wrapper.Dispose(isolate); 49 50 wrapper.Clear(); 50 51 } … … 56 57 for (; it != m_constructorMap.end(); ++it) { 57 58 v8::Persistent<v8::Function> wrapper = it->value; 58 wrapper.Dispose( );59 wrapper.Dispose(isolate); 59 60 wrapper.Clear(); 60 61 } … … 103 104 v8::Local<v8::Object> instance = V8ObjectConstructor::newInstance(function); 104 105 if (!instance.IsEmpty()) { 105 m_wrapperBoilerplates.set(type, v8::Persistent<v8::Object>::New( instance));106 m_wrapperBoilerplates.set(type, v8::Persistent<v8::Object>::New(m_context->GetIsolate(), instance)); 106 107 return instance->Clone(); 107 108 } … … 131 132 } 132 133 133 m_constructorMap.set(type, v8::Persistent<v8::Function>::New( function));134 m_constructorMap.set(type, v8::Persistent<v8::Function>::New(m_context->GetIsolate(), function)); 134 135 135 136 return function; -
trunk/Source/WebCore/bindings/v8/V8ValueCache.cpp
r142154 r142250 67 67 StringImpl* stringImpl = static_cast<StringImpl*>(parameter); 68 68 V8PerIsolateData::current()->stringCache()->remove(stringImpl); 69 wrapper.Dispose( );69 wrapper.Dispose(isolate); 70 70 wrapper.Clear(); 71 71 stringImpl->deref(); … … 87 87 88 88 v8::Persistent<v8::String> cachedV8String = m_stringCache.get(stringImpl); 89 if (cachedV8String.IsWeak( )) {89 if (cachedV8String.IsWeak(isolate)) { 90 90 m_lastStringImpl = stringImpl; 91 91 m_lastV8String = cachedV8String; … … 99 99 return newString; 100 100 101 v8::Persistent<v8::String> wrapper = v8::Persistent<v8::String>::New( newString);101 v8::Persistent<v8::String> wrapper = v8::Persistent<v8::String>::New(isolate, newString); 102 102 if (wrapper.IsEmpty()) 103 103 return newString; 104 104 105 105 stringImpl->ref(); 106 wrapper.MarkIndependent( );106 wrapper.MarkIndependent(isolate); 107 107 wrapper.MakeWeak(isolate, stringImpl, cachedStringCallback); 108 108 m_stringCache.set(stringImpl, wrapper); -
trunk/Source/WebCore/bindings/v8/WrapperTypeInfo.h
r142159 r142250 151 151 void configureWrapper(v8::Persistent<v8::Object> wrapper, v8::Isolate* isolate) const 152 152 { 153 wrapper.SetWrapperClassId( classId);153 wrapper.SetWrapperClassId(isolate, classId); 154 154 if (lifetime == Independent) 155 155 wrapper.MarkIndependent(isolate); -
trunk/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
r141977 r142250 57 57 DEFINE_STATIC_LOCAL(v8::Persistent<v8::FunctionTemplate>, shadowTemplate, ()); 58 58 if (shadowTemplate.IsEmpty()) { 59 shadowTemplate = v8::Persistent<v8::FunctionTemplate>::New( v8::FunctionTemplate::New());59 shadowTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New()); 60 60 if (shadowTemplate.IsEmpty()) 61 61 return v8::Local<v8::Object>(); -
trunk/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
r142159 r142250 96 96 result->Inherit(V8HTMLImageElement::GetTemplate(isolate)); 97 97 98 cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New( result);98 cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, result); 99 99 return cachedTemplate; 100 100 } -
trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp
r141771 r142250 50 50 InjectedScriptHost* nativeObject = static_cast<InjectedScriptHost*>(parameter); 51 51 nativeObject->deref(); 52 object.Dispose( );52 object.Dispose(isolate); 53 53 object.Clear(); 54 54 } … … 70 70 // InspectorBackend when the wrapper is garbage collected. 71 71 host->ref(); 72 v8::Persistent<v8::Object> weakHandle = v8::Persistent<v8::Object>::New(i nstance);72 v8::Persistent<v8::Object> weakHandle = v8::Persistent<v8::Object>::New(isolate, instance); 73 73 weakHandle.MakeWeak(isolate, host, &WeakReferenceCallback); 74 74 return instance; -
trunk/Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp
r140883 r142250 139 139 v8::Handle<v8::Value> V8Location::reloadAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) 140 140 { 141 static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8Location::reloadCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(info.GetIsolate())))); 142 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(info.GetIsolate())); 141 v8::Isolate* isolate = info.GetIsolate(); 142 static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::reloadCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate)))); 143 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(isolate)); 143 144 if (holder.IsEmpty()) { 144 145 // can only reach here by 'object.__proto__.func', and it should passed … … 148 149 Location* imp = V8Location::toNative(holder); 149 150 if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) { 150 static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New( v8::FunctionTemplate::New(V8Location::reloadCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(info.GetIsolate()))));151 static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::reloadCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate)))); 151 152 return sharedTemplate->GetFunction(); 152 153 } … … 156 157 v8::Handle<v8::Value> V8Location::replaceAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) 157 158 { 158 static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8Location::replaceCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(info.GetIsolate())))); 159 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(info.GetIsolate())); 159 v8::Isolate* isolate = info.GetIsolate(); 160 static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::replaceCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate)))); 161 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(isolate)); 160 162 if (holder.IsEmpty()) { 161 163 // can only reach here by 'object.__proto__.func', and it should passed … … 165 167 Location* imp = V8Location::toNative(holder); 166 168 if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) { 167 static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New( v8::FunctionTemplate::New(V8Location::replaceCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(info.GetIsolate()))));169 static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::replaceCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate)))); 168 170 return sharedTemplate->GetFunction(); 169 171 } … … 173 175 v8::Handle<v8::Value> V8Location::assignAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) 174 176 { 177 v8::Isolate* isolate = info.GetIsolate(); 175 178 static v8::Persistent<v8::FunctionTemplate> privateTemplate = 176 v8::Persistent<v8::FunctionTemplate>::New( v8::FunctionTemplate::New(V8Location::assignCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(info.GetIsolate()))));177 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(i nfo.GetIsolate()));179 v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::assignCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate)))); 180 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(isolate)); 178 181 if (holder.IsEmpty()) { 179 182 // can only reach here by 'object.__proto__.func', and it should passed … … 183 186 Location* imp = V8Location::toNative(holder); 184 187 if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) { 185 static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New( v8::FunctionTemplate::New(V8Location::assignCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(info.GetIsolate()))));188 static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::assignCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate)))); 186 189 return sharedTemplate->GetFunction(); 187 190 } -
trunk/Source/WebKit/chromium/ChangeLog
r142214 r142250 1 2013-02-08 Dan Carney <dcarney@google.com> 2 3 [v8] isolate parameter added to all v8::peristent calls 4 https://bugs.webkit.org/show_bug.cgi?id=109268 5 6 Reviewed by Kentaro Hara. 7 8 * tests/WebFrameTest.cpp: 9 1 10 2013-02-07 Kent Tamura <tkent@chromium.org> 2 11 -
trunk/Source/WebKit/chromium/tests/WebFrameTest.cpp
r142093 r142250 988 988 public: 989 989 Notification(WebFrame* frame, v8::Handle<v8::Context> context, int worldId) 990 : frame(frame) ,991 context(v8::Persistent<v8::Context>::New(context)),992 990 : frame(frame) 991 , context(v8::Persistent<v8::Context>::New(context->GetIsolate(), context)) 992 , worldId(worldId) 993 993 { 994 994 } … … 996 996 ~Notification() 997 997 { 998 context.Dispose( );998 context.Dispose(context->GetIsolate()); 999 999 } 1000 1000
Note: See TracChangeset
for help on using the changeset viewer.