TestRunner needs to implement originsWithApplicationCache(). This is needed by the following test case: http/tests/appcache/origins-with-appcache.html
Created attachment 187208 [details] Patch
Created attachment 187209 [details] Patch
Comment on attachment 187209 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=187209&action=review > Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp:868 > +JSValueRef DumpRenderTreeSupportGtk::originsWithApplicationCache(JSContextRef context) > +{ > + HashSet<RefPtr<SecurityOrigin>, SecurityOriginHash> origins; > + cacheStorage().getOriginsWithCache(origins); > + Vector<JSValueRef> jsOriginsVector; > + > + HashSet<RefPtr<SecurityOrigin>, SecurityOriginHash>::iterator it = origins.begin(); > + HashSet<RefPtr<SecurityOrigin>, SecurityOriginHash>::iterator end = origins.end(); > + for ( ; it != end; ++it) { > + String origin = (*it)->databaseIdentifier(); > + JSRetainPtr<JSStringRef> originJS(Adopt, JSStringCreateWithCharacters(origin.characters(), origin.length())); > + jsOriginsVector.append(JSValueMakeString(context, originJS.get())); > + } > + > + return JSObjectMakeArray(context, jsOriginsVector.size(), jsOriginsVector.data(), 0); > +} It'd probably make sense for this to return Vector<String> and then to convert that to an array in DumpRenderTree.
(In reply to comment #3) > It'd probably make sense for this to return Vector<String> and then to convert that to an array in DumpRenderTree. Okay. It sounds better. I will upload a new patch.
Created attachment 187217 [details] Patch
Comment on attachment 187217 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=187217&action=review > Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp:660 > + JSRetainPtr<JSStringRef> originJS(Adopt, JSStringCreateWithCharacters(origin.characters(), origin.length())); > + jsOriginsVector.append(JSValueMakeString(context, originJS.get())); Hrm. Upon closer examination of this code I think there's an issue here. You are creating RetainPtr that is going out of scope immediately. I suspect that the memory you are using is either no longer allocated or susceptible to garbage collection.
(In reply to comment #6) > > Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp:660 > > + JSRetainPtr<JSStringRef> originJS(Adopt, JSStringCreateWithCharacters(origin.characters(), origin.length())); > > + jsOriginsVector.append(JSValueMakeString(context, originJS.get())); > > Hrm. Upon closer examination of this code I think there's an issue here. You are creating RetainPtr that is going out of scope immediately. I suspect that the memory you are using is either no longer allocated or susceptible to garbage collection. I think there is no problem because the newly created JSValue created by JSValueMakeString retains the given string and releases it upon garbage collection. Please refer to the documentation of JSValueMakeString: http://developer.apple.com/library/mac/#documentation/JavaScriptCore/Reference/JSValueRef_header_reference/Reference/reference.html#//apple_ref/doc/uid/TP40011501
(In reply to comment #7) > I think there is no problem because the newly created JSValue created by JSValueMakeString retains the given string and releases it upon garbage collection. This is only safe if JSValueMakeString cannot itself cause garbage collection. Another thing to keep in mind is that if you are relying on this property, you don't need a JSRetainPtr. I don't know now whether JSValueMakeString can cause a garbage collection, but if it can there's some issues here.
(In reply to comment #8) > This is only safe if JSValueMakeString cannot itself cause garbage collection. Another thing to keep in mind is that if you are relying on this property, you don't need a JSRetainPtr. I don't know now whether JSValueMakeString can cause a garbage collection, but if it can there's some issues here. I see your point. I will check it again when I get back to work from the holiday.
Comment on attachment 187217 [details] Patch Interesting patch but the issue Martin spotted seems quite serious. I suspect the patch also needs a rebase :/