[webkit-dev] How can I listen for a page load complete event
Darin Adler
darin at apple.com
Tue May 5 09:09:40 PDT 2009
On May 4, 2009, at 11:32 PM, Meryl Silverburgh wrote:
> Thank you. If implementating the 'didFinishLoadForFrame' method is
> to listen for browser finishing loading everything, then some please
> in webkit code must call the didFinishLoadForFrame' to tell the
> delegate that page load is done, right?
>
> But when i search the code, i only find these places calling. None
> of them is calling didFinishLoadForFrame on MacOS. Can you please
> tell me what am i missing?
The easiest way to answer a question like this is to run Safari under
the debugger and set a breakpoint, then look at the backtrace.
(gdb) rb webView:didFinishLoadForFrame:
(gdb) run
#0 -[LocationChangeHandler webView:didFinishLoadForFrame:]
(self=0x11f8d70, _cmd=0x98ea6c, sender=0x11de720, frame=0x1d0632a0)
#1 0x00951536 in CallDelegate (implementation=0xf169e <-
[LocationChangeHandler webView:didFinishLoadForFrame:]>,
self=0x11de720, delegate=0x11f8d70, selector=0x98ea6c,
object=0x1d0632a0) at /Users/darin/Safari/OpenSource/WebKit/mac/
WebView/WebView.mm:5532
#2 0x009515af in CallFrameLoadDelegate (implementation=0xf169e <-
[LocationChangeHandler webView:didFinishLoadForFrame:]>,
self=0x11de720, selector=0x98ea6c, object=0x1d0632a0) at /Users/darin/
Safari/OpenSource/WebKit/mac/WebView/WebView.mm:5732
#3 0x008d57ff in WebFrameLoaderClient::dispatchDidFinishLoad
(this=0x1d063760) at /Users/darin/Safari/OpenSource/WebKit/mac/
WebCoreSupport/WebFrameLoaderClient.mm:614
#4 0x03775f40 in WebCore::FrameLoader::checkLoadCompleteForThisFrame
(this=0x733742c) at /Users/darin/Safari/OpenSource/WebCore/loader/
FrameLoader.cpp:3353
#5 0x037760ac in WebCore::FrameLoader::recursiveCheckLoadComplete
(this=0x733742c) at /Users/darin/Safari/OpenSource/WebCore/loader/
FrameLoader.cpp:3474
#6 0x03776096 in WebCore::FrameLoader::recursiveCheckLoadComplete
(this=0x70a1c2c) at /Users/darin/Safari/OpenSource/WebCore/loader/
FrameLoader.cpp:3472
#7 0x03776153 in WebCore::FrameLoader::checkLoadComplete
(this=0x733742c) at /Users/darin/Safari/OpenSource/WebCore/loader/
FrameLoader.cpp:3485
#8 0x036f4e6d in WebCore::DocumentLoader::removeSubresourceLoader
(this=0x70dbc00, loader=0x737f400) at /Users/darin/Safari/OpenSource/
WebCore/loader/DocumentLoader.cpp:774
#9 0x03ce0e80 in WebCore::SubresourceLoader::didFinishLoading
(this=0x737f400) at /Users/darin/Safari/OpenSource/WebCore/loader/
SubresourceLoader.cpp:189
#10 0x03bbfa2c in WebCore::ResourceLoader::didFinishLoading
(this=0x737f400) at /Users/darin/Safari/OpenSource/WebCore/loader/
ResourceLoader.cpp:416
#11 0x03bbce90 in -[WebCoreResourceHandleAsDelegate
connectionDidFinishLoading:] (self=0x1d077fe0, _cmd=0x96073564,
unusedConnection=0x1d07d800) at /Users/darin/Safari/OpenSource/WebCore/
platform/network/mac/ResourceHandleMac.mm:649
#12 0x94c06cd7 in -[NSURLConnection(NSURLConnectionReallyInternal)
sendDidFinishLoading] ()
#13 0x94c06c43 in _NSURLConnectionDidFinishLoading ()
#14 0x936e11f4 in URLConnectionClient::clientDidFinishLoading ()
#15 0x936dfd31 in
URLConnectionClient
::ClientConnectionEventQueue::processAllEventsAndConsumePayload ()
#16 0x936e0d70 in URLConnectionClient::processEvents ()
#17 0x93690b6b in MultiplexerSource::perform ()
#18 0x95d0b5f5 in CFRunLoopRunSpecific ()
#19 0x95d0bcd8 in CFRunLoopRunInMode ()
#20 0x9634f2c0 in RunCurrentEventLoopInMode ()
#21 0x9634f0d9 in ReceiveNextEventCommon ()
#22 0x9634ef4d in BlockUntilNextEventMatchingListInMode ()
#23 0x937bbd7d in _DPSNextEvent ()
#24 0x937bb630 in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#25 0x001b2313 in -[BrowserApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] (self=0x1120a50,
_cmd=0x96026b80, mask=4294967295, expiration=0x11cb970,
mode=0xa0783b40, dequeue=1 '\001')
#26 0x937b466b in -[NSApplication run] ()
#27 0x937818a4 in NSApplicationMain ()
#28 0x00032168 in main (argc=1, argv=0xbffff514)
-- Darin
More information about the webkit-dev
mailing list