Re: [webkit-dev] FrameLoaderClient notifications

2008-03-13 Thread Darin Adler

On Mar 13, 2008, at 8:50 AM, Artem Ananiev wrote:

I suppose the following order of loading events for a page with a  
single frame (please, correct me, if I'm wrong):


page load started
main document load started
title received
icon received
* main document load finished
** resource load started
resource load finished
page load finished


The the FrameLoaderClient functions about the frame (not the ones that  
take DocumentLoader*) are what you want. They are all about this  
cycle. dispatchDidStartProvisionalLoad is the one that goes first, and  
then there are quite a few others, ending with dispatchDidFinishLoad,  
dispatchDidFailLoad or dispatchDidFailProvisionalLoad.



OK, I see. Is there any other load process other than provisional?


All loads start provisional.

dispatchWillSendRequest will be called repeatedly with different  
URLs when a server does redirection. This is normal. How it should  
be handled depends on what API you've devised.


Is there any separate notification about redirection, or this method  
is enough?


There is
dispatchDidReceiveServerRedirectForProvisionalLoad for loads of the  
main resource of a frame, but dispatchWillSendRequest alone is all  
that's needed for arbitrary resource loads.


One more question: is there any method about starting loading of an  
external resource? Is it dispatchWillSendRequest?  
dispatchDidReceiveResponse?


assignIdentifierToInitialRequest and dispatchWillSendRequest

-- Darin

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] FrameLoaderClient notifications

2008-03-13 Thread Artem Ananiev

Please, see my comments below.

Darin Adler wrote:

On Mar 13, 2008, at 4:11 AM, Artem Ananiev wrote:

I work on dispatching web load/progress events for Java port and have 
some questions about notifications in FrameLoaderClient class.


1. What is the right method to implement to get a 'page load started' 
and 'page load finished' events? I tried the following methods:


postProgressStartedNotification()
postProgressFinishedNotification()

and the problem is they don't accept any params, so I can't get an URL 
being loaded. If I obtain the URL from frame->loader->documentLoader, 
it works for 'progress finished' notification, but returns an old URL 
for 'progress started'.


I have no idea what you mean by "page load started" and "finished". If 
you look at the Mac port you'll see many different types of calls for 
these purposes. The ones you mention above are best for loading 
progress, as in a progress bar.


I suppose the following order of loading events for a page with a single 
frame (please, correct me, if I'm wrong):


page load started
main document load started
title received
icon received
* main document load finished
** resource load started
resource load finished
page load finished

Notes:

* = at this time some of the external resources like images may not be 
loaded yet

** = some resources may be loaded simultaneously

After the page is loaded, more 'resource load started' and 'resource 
load finished' may be triggered by user actions or JavaScript calls.


2. What is the right method to implement to get a 'main document load 
started'?


dispatchDidStartProvisionalLoad


OK, I see. Is there any other load process other than provisional?

3. As I understand, the right way to handle resources (for example, 
images) loading is to track methods


assignIdentifierToInitialRequest()
dispatchWillSendRequest()
dispatchDidFinishLoading()

The latter two methods provide request identifiers which are assigned 
in the former one. However, sometimes I see two 
'dispatchWillSendRequest' calls with the same ids and different URLs. 
For example, when loading www.google.com I the first URL is 
www.google.com and the second is www.google.co.uk. How is this 
situation should be handled?


dispatchWillSendRequest will be called repeatedly with different URLs 
when a server does redirection. This is normal. How it should be handled 
depends on what API you've devised.


Is there any separate notification about redirection, or this method is 
enough?



4. There are several notifications about resource loading is finished:

dispatchDidFinishLoading()
dispatchDidFinishLoad()
dispatchDidFinishDocumentLoad()

didFinishLoad() - is this a notification?
finishedLoading() - is this a notification?

Some of them provide DocumentLoader instances, others have no 
parameters passed. What is the difference between these methods? Are 
some of them outdated and shouldn't be used at all?


- dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier)

This is called when done loading an individual resource, such as an 
image, script, or the main resource for a page.


One more question: is there any method about starting loading of an 
external resource? Is it dispatchWillSendRequest? 
dispatchDidReceiveResponse?



- dispatchDidFinishDocumentLoad()

This is called when done loading the document for a frame, usually HTML, 
but not all the resources such as images.


- dispatchDidFinishLoad()

This is called when done loading an entire frame and its resources. Like 
the HTML load event.


OK, thanks, this is very useful information.

Artem


-- Darin

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] FrameLoaderClient notifications

2008-03-13 Thread Darin Adler

On Mar 13, 2008, at 4:11 AM, Artem Ananiev wrote:

I work on dispatching web load/progress events for Java port and  
have some questions about notifications in FrameLoaderClient class.


1. What is the right method to implement to get a 'page load  
started' and 'page load finished' events? I tried the following  
methods:


postProgressStartedNotification()
postProgressFinishedNotification()

and the problem is they don't accept any params, so I can't get an  
URL being loaded. If I obtain the URL from frame->loader- 
>documentLoader, it works for 'progress finished' notification, but  
returns an old URL for 'progress started'.


I have no idea what you mean by "page load started" and "finished". If  
you look at the Mac port you'll see many different types of calls for  
these purposes. The ones you mention above are best for loading  
progress, as in a progress bar.


2. What is the right method to implement to get a 'main document  
load started'?


dispatchDidStartProvisionalLoad

3. As I understand, the right way to handle resources (for example,  
images) loading is to track methods


assignIdentifierToInitialRequest()
dispatchWillSendRequest()
dispatchDidFinishLoading()

The latter two methods provide request identifiers which are  
assigned in the former one. However, sometimes I see two  
'dispatchWillSendRequest' calls with the same ids and different  
URLs. For example, when loading www.google.com I the first URL is www.google.com 
 and the second is www.google.co.uk. How is this situation should be  
handled?


dispatchWillSendRequest will be called repeatedly with different URLs  
when a server does redirection. This is normal. How it should be  
handled depends on what API you've devised.



4. There are several notifications about resource loading is finished:

dispatchDidFinishLoading()
dispatchDidFinishLoad()
dispatchDidFinishDocumentLoad()

didFinishLoad() - is this a notification?
finishedLoading() - is this a notification?

Some of them provide DocumentLoader instances, others have no  
parameters passed. What is the difference between these methods? Are  
some of them outdated and shouldn't be used at all?


- dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier)

This is called when done loading an individual resource, such as an  
image, script, or the main resource for a page.


- dispatchDidFinishDocumentLoad()

This is called when done loading the document for a frame, usually  
HTML, but not all the resources such as images.


- dispatchDidFinishLoad()

This is called when done loading an entire frame and its resources.  
Like the HTML load event.


-- Darin

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] FrameLoaderClient notifications

2008-03-13 Thread Patrick Hanna
Can you get the provisionalDocumentLoader from the FrameLoader and use  
that url?


Patrick

On Mar 13, 2008, at 9:19 AM, Artem Ananiev wrote:


Hi, Patrick,

in Java port we do the same: store Frame* in FrameLoaderClient.  
However, this frame's loader URL can't be used, for example, in  
postProgressStartedNotification as it contains the current URL, not  
the URL which is about to be loaded...


Thanks,

Artem

Patrick Hanna wrote:

Artem,
For our port, we construct the FrameLoaderClient with a pointer to  
the Frame object. So in all the progress notification callbacks we  
can say m_frame->loader()->url() or whatever to get the current url  
of the frame.

Patrick
On Mar 13, 2008, at 7:11 AM, Artem Ananiev wrote:

Hi,

I work on dispatching web load/progress events for Java port and  
have some questions about notifications in FrameLoaderClient class.


1. What is the right method to implement to get a 'page load  
started' and 'page load finished' events? I tried the following  
methods:


postProgressStartedNotification()
postProgressFinishedNotification()

and the problem is they don't accept any params, so I can't get an  
URL being loaded. If I obtain the URL from frame->loader- 
>documentLoader, it works for 'progress finished' notification,  
but returns an old URL for 'progress started'.


2. What is the right method to implement to get a 'main document  
load started'? I see the method


dispatchDidLoadMainResource()

but there is no similar method about starting...

3. As I understand, the right way to handle resources (for  
example, images) loading is to track methods


assignIdentifierToInitialRequest()
dispatchWillSendRequest()
dispatchDidFinishLoading()

The latter two methods provide request identifiers which are  
assigned in the former one. However, sometimes I see two  
'dispatchWillSendRequest' calls with the same ids and different  
URLs. For example, when loading www.google.com I the first URL is www.google.com 
 and the second is www.google.co.uk. How is this situation should  
be handled?


4. There are several notifications about resource loading is  
finished:


dispatchDidFinishLoading()
dispatchDidFinishLoad()
dispatchDidFinishDocumentLoad()

didFinishLoad() - is this a notification?
finishedLoading() - is this a notification?

Some of them provide DocumentLoader instances, others have no  
parameters passed. What is the difference between these methods?  
Are some of them outdated and shouldn't be used at all?


Thanks,

Artem
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] FrameLoaderClient notifications

2008-03-13 Thread Artem Ananiev

Hi, Patrick,

in Java port we do the same: store Frame* in FrameLoaderClient. However, 
this frame's loader URL can't be used, for example, in 
postProgressStartedNotification as it contains the current URL, not the 
URL which is about to be loaded...


Thanks,

Artem

Patrick Hanna wrote:

Artem,

For our port, we construct the FrameLoaderClient with a pointer to the 
Frame object. So in all the progress notification callbacks we can say 
m_frame->loader()->url() or whatever to get the current url of the frame.


Patrick

On Mar 13, 2008, at 7:11 AM, Artem Ananiev wrote:


Hi,

I work on dispatching web load/progress events for Java port and have 
some questions about notifications in FrameLoaderClient class.


1. What is the right method to implement to get a 'page load started' 
and 'page load finished' events? I tried the following methods:


postProgressStartedNotification()
postProgressFinishedNotification()

and the problem is they don't accept any params, so I can't get an URL 
being loaded. If I obtain the URL from frame->loader->documentLoader, 
it works for 'progress finished' notification, but returns an old URL 
for 'progress started'.


2. What is the right method to implement to get a 'main document load 
started'? I see the method


dispatchDidLoadMainResource()

but there is no similar method about starting...

3. As I understand, the right way to handle resources (for example, 
images) loading is to track methods


assignIdentifierToInitialRequest()
dispatchWillSendRequest()
dispatchDidFinishLoading()

The latter two methods provide request identifiers which are assigned 
in the former one. However, sometimes I see two 
'dispatchWillSendRequest' calls with the same ids and different URLs. 
For example, when loading www.google.com I the first URL is 
www.google.com and the second is www.google.co.uk. How is this 
situation should be handled?


4. There are several notifications about resource loading is finished:

dispatchDidFinishLoading()
dispatchDidFinishLoad()
dispatchDidFinishDocumentLoad()

didFinishLoad() - is this a notification?
finishedLoading() - is this a notification?

Some of them provide DocumentLoader instances, others have no 
parameters passed. What is the difference between these methods? Are 
some of them outdated and shouldn't be used at all?


Thanks,

Artem
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev



___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] FrameLoaderClient notifications

2008-03-13 Thread Patrick Hanna

Artem,

For our port, we construct the FrameLoaderClient with a pointer to the  
Frame object. So in all the progress notification callbacks we can say  
m_frame->loader()->url() or whatever to get the current url of the  
frame.


Patrick

On Mar 13, 2008, at 7:11 AM, Artem Ananiev wrote:


Hi,

I work on dispatching web load/progress events for Java port and  
have some questions about notifications in FrameLoaderClient class.


1. What is the right method to implement to get a 'page load  
started' and 'page load finished' events? I tried the following  
methods:


postProgressStartedNotification()
postProgressFinishedNotification()

and the problem is they don't accept any params, so I can't get an  
URL being loaded. If I obtain the URL from frame->loader- 
>documentLoader, it works for 'progress finished' notification, but  
returns an old URL for 'progress started'.


2. What is the right method to implement to get a 'main document  
load started'? I see the method


dispatchDidLoadMainResource()

but there is no similar method about starting...

3. As I understand, the right way to handle resources (for example,  
images) loading is to track methods


assignIdentifierToInitialRequest()
dispatchWillSendRequest()
dispatchDidFinishLoading()

The latter two methods provide request identifiers which are  
assigned in the former one. However, sometimes I see two  
'dispatchWillSendRequest' calls with the same ids and different  
URLs. For example, when loading www.google.com I the first URL is www.google.com 
 and the second is www.google.co.uk. How is this situation should be  
handled?


4. There are several notifications about resource loading is finished:

dispatchDidFinishLoading()
dispatchDidFinishLoad()
dispatchDidFinishDocumentLoad()

didFinishLoad() - is this a notification?
finishedLoading() - is this a notification?

Some of them provide DocumentLoader instances, others have no  
parameters passed. What is the difference between these methods? Are  
some of them outdated and shouldn't be used at all?


Thanks,

Artem
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev


[webkit-dev] FrameLoaderClient notifications

2008-03-13 Thread Artem Ananiev

Hi,

I work on dispatching web load/progress events for Java port and have 
some questions about notifications in FrameLoaderClient class.


1. What is the right method to implement to get a 'page load started' 
and 'page load finished' events? I tried the following methods:


postProgressStartedNotification()
postProgressFinishedNotification()

and the problem is they don't accept any params, so I can't get an URL 
being loaded. If I obtain the URL from frame->loader->documentLoader, it 
works for 'progress finished' notification, but returns an old URL for 
'progress started'.


2. What is the right method to implement to get a 'main document load 
started'? I see the method


dispatchDidLoadMainResource()

but there is no similar method about starting...

3. As I understand, the right way to handle resources (for example, 
images) loading is to track methods


assignIdentifierToInitialRequest()
dispatchWillSendRequest()
dispatchDidFinishLoading()

The latter two methods provide request identifiers which are assigned in 
the former one. However, sometimes I see two 'dispatchWillSendRequest' 
calls with the same ids and different URLs. For example, when loading 
www.google.com I the first URL is www.google.com and the second is 
www.google.co.uk. How is this situation should be handled?


4. There are several notifications about resource loading is finished:

dispatchDidFinishLoading()
dispatchDidFinishLoad()
dispatchDidFinishDocumentLoad()

didFinishLoad() - is this a notification?
finishedLoading() - is this a notification?

Some of them provide DocumentLoader instances, others have no parameters 
passed. What is the difference between these methods? Are some of them 
outdated and shouldn't be used at all?


Thanks,

Artem
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev