Hi Nav folks,
I noticed that it's possible for RenderFrameHost::GetLastCommittedURL() to return a different value from WebContents::GetLastCommittedURL() (even when the RenderFrameHost is from WebContents::GetPrimaryMainFrame())
In the particular case I discovered, when first opening a new tab, RFH is returning chrome://new-tab-page/ while WC returns chrome://newtab/
Digging around, it seems that new tabs initially navigate to chrome://new-tab-page/ and RFH reports that, but thanks to
virtual URLs WC rewrites and reports it as chrome://newtab/
Is it intentional for these to differ?
The new tab page is a very special case, with a non-http scheme, but could this happen in more general cases? I'm interested because DIPS (
go/dips) uses GetLastCommittedURL() for a number of things, and now I'm wondering which I should use.
Since I'm interested mainly in which domain accessed storage (e.g. cookies), if the URL domain could vary, I think I want the non-virtual one, assuming that's the one that actually accessed the storage. Is that correct? Should I call GetPrimaryMainFrame()->GetLastCommittedURL() instead of GetLastCommittedURL()?
Thanks,
Ryan