Bug 16606

Summary: [Gtk] Clean up WebKitWebFrame initialization code
Product: WebKit Reporter: Christian Dywan <christian>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: agent.couper, alp, cjlhomeaddress, mrobinson, xan.lopez
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: Other   
OS: Linux   
Attachments:
Description Flags
Cleanup and renaming
none
updated none

Description Christian Dywan 2007-12-25 11:30:07 PST
There is no initialization code in webkit_web_frame_init. Also webkit_web_frame_new and webkit_web_frame_init_with_web_view contain very similar code that can be merged.
Furthermore webkit_web_frame_init_with_web_view is misnamed.
Comment 1 Christian Dywan 2007-12-25 11:38:36 PST
Created attachment 18111 [details]
Cleanup and renaming

Rename webkit_web_frame_init_with_web_view to webkit_web_frame_new_with_element.

Cleanup initialization code in webkit_web_frame_init, webkit_web_frame_new and webkit_web_frame_new_with_element.
Comment 2 Alp Toker 2007-12-29 23:54:24 PST
-    frameView->deref();

What's this change for?
Comment 3 Xan Lopez 2007-12-30 04:54:40 PST
+    frameData->name = 0;
+    frameData->title = 0;
+    frameData->uri = 0;

FWIW, this is redundant. Private data is zeroed when created already.
Comment 4 Christian Dywan 2007-12-30 11:51:50 PST
Created attachment 18196 [details]
updated
Comment 5 Christian Dywan 2008-01-03 23:09:28 PST
Comment on attachment 18196 [details]
updated

Clearing review in favor of a bit more investigation.
Comment 6 Leonid Romanov 2008-01-15 11:35:07 PST
Recently, I've been investigating where and how WebKitWebFrame instance created by FrameLoaderClient::createFrame() method gets freed. Someone on irc, where I looked for help, has asked me to report my findings here, on bugzilla. So, here we go.
I used RefDbg tool to trace GObjects creation/refs/derefs/finalization and according to it, the only WebKitWebFrame instance that gets freed is the main frame. Other frames, created via webkit_web_frame_init_with_web_view are never freed. 
Here what I did:
- Download and compile RefDbg from http://refdbg.sourceforge.net/
- Compile debug version of WebKit GTK
- Start GtkLauncher under RefDbg with http://www.w3schools.com/html/tryit.asp?filename=tryhtml_frame_cols as page to open
- Wait till page fully loads and then close GtkLauncher.
- Examine RefDbg log for leaks 
Comment 7 Martin Robinson 2010-11-27 09:25:24 PST
I just ran this test in a recent build of GtkLauncher. I couldn't get RefDbg working, so I just put print statements in the WebKitWebFrame finalization method. If I quit GtkLauncher on the test page, there were many frames that were not finalized, but if I left the page for a blank page before exiting (by accessing a non-existent address), only the main frame was not finalized. This doesn't appear to be an issue any longer.
Comment 8 Chris Leonard 2012-03-26 20:53:29 PDT
Can it be conformed whether or not thsi is still a current issue and if not can this ticket be clsoed?
Comment 9 Martin Robinson 2012-03-28 10:37:51 PDT
(In reply to comment #8)
> Can it be conformed whether or not thsi is still a current issue and if not can this ticket be clsoed?

Well, the original bug isn't about the RefDbg issue you mentioned in comment #6, so do you mean the original cleanup or the issue you mentioned?
Comment 10 Martin Robinson 2014-04-08 17:53:56 PDT
WebKit1GTK+ has been removed.