[Webkit-unassigned] [Bug 25867] [QT] Implement original_url getter method to the API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 3 06:09:59 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=25867





------- Comment #3 from tonikitoo at gmail.com  2009-06-03 06:09 PDT -------
TESTCASE:

In practical terms, I am calling "original url" here the url fixed but not yet
resolved
loaded by the current main frame, e.g. :

1) if user runs: $ ./QtLauncher google.com
2) it gets "fixed" to "http://google.com/"
3) it gets "resolved" to "http://www.google.com"
4) sometimes it also gets "redirected" to other pages , e.g.
"http://www.google.com.br"

--> originalUrl() would return 2).
--> url() would return either 3) or 4).

SCENARIO:

The motivation for this simple add comes from a feature we needed to implement
a while back while working on a frontend for our webkit-efl port [1], and we
thought that it could also be useful for other ports.

[1]
http://code.staikos.net/cgi-bin/gitweb.cgi?p=webkit;a=shortlog;h=shared/webkit-efl

In our case we had the following scenario:

1) we have a history management implemented in ui side.
2) during the mainFrame's loading process, it firstly calls
|WebCoreSupport::updateGlobalHistory()| passing the URL being loaded(see quoted
code below). It is the url not resolved or redirected yet.

(...)
void FrameLoaderClientQt::updateGlobalHistory()
{
   QWebHistoryInterface *history = QWebHistoryInterface::defaultInterface();
   if (history)
      
history->addHistoryEntry(m_frame->loader()->documentLoader()->urlForHistory().prettyURL());
}
(...)

We stored the url passed in in our history database as a primary key.

3) yet in the loading process, server responses to the loading process and we
get urlChanged and titleChanged signals emited. In our case, we want to update
the history database entry of the just obtained |title| for the web page. At
that time (when titleChanged signal gets emited) we get the original url by
calling mainFrame->originalUrl(), find the history entry in the database
associated to it and update it w/ the new title value.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list