PSA: upcoming changes to navigations in Chrome

1,617 views
Skip to first unread message

Camille Lamy

unread,
Jan 11, 2016, 1:21:37 PM1/11/16
to chromium-dev

Hi Chromiumers,


As anyone from House Stark would say: "PlzNavigate is coming."


This is an update about the future of navigation in Chrome (aka the PlzNavigate project). We've been moving the navigation logic out of the renderer process and into the browser process for 18 months, and are coming closer to completion (see crbug.com/368813 for the meta-bug tracking this work and this design doc). When finished this change will bring improvements in code organization, performance and security.


Concretely, the main changes to navigation are the following:

  • The navigation – be it browser or renderer initiated – is handled by the browser process until it is ready to commit. In particular the renderer process is not aware of it until that point in time.

  • The renderer to be used for the navigation is only selected when the navigation is ready to commit. No RenderFrameHost is associated with the navigation prior to that.


We are aware of many systems in chrome/ and components/ that still don’t work with PlzNavigate enabled. And there's possibly more we are not aware of yet. So we need your help to fix them!


What does that mean for you as a developer?

If you are working outside of content/, you may have to change part of your code to use the new content/public/ navigation observer API. The new API should work consistently over the current architecture of navigations and the new architecture we're introducing.


This concerns you if:

  • You have a WebContentsObserver that needs to be informed about navigation events. You will need to switch to using the newly introduced methods that give access to a NavigationHandle instead of the old methods. This is the new navigation observer API, that works consistently over the current architecture of navigations and the new architecture we're introducing.

  • You are listening to the content notifications system for navigation notifications. Notifications have been deprecated for a certain amount of time and you should switch to using a WebContentsObserver.

  • You are using a ResourceThrottle for a main resource or subframe request. It will need to be converted to a NavigationThrottle. Note that you will still need a ResourceThrottle for subresource requests if your ResourceThrottle cares about  subresources as well.

  • You want to have access to a WebContents from the ResourceRequest. You will not be provided with a process id/routing id pair in the ResourceRequestInfo for main resources. To get the WebContents, use the WebContentsGetter of the ResourceRequestInfo instead.

  • You need to do setup work in the renderer before the navigation commits. Instead of doing it following the call to WebContentsObserver::DidStartProvisionalLoad, do it following WebContentsObserver::ReadyToCommitNavigation.

  • You are using RenderFrameHost ids to track navigation in a particular frame. You will need to use a NavigationHandle.


(Note: the new navigation API is still under development and not fully feature complete. Don’t hesitate to discuss more features to be added to it to support your component.)


A) You are a Chromium developer and your feature has tests

Great! We are running the tests with browser-side navigation enabled and keep track of the failures. We may contact you in the future to assist you in updating your code. If you want to check it yourself, run your tests with the flag --enable-browser-side-navigation (keep in mind the known issues in content that may break the tests). We have an FYI bot running those (Browser side navigation Linux). We will also soon have a trybot that you’ll be able to use to check the effect of your CLs on PlzNavigate.


B) You are an external developer/a Chromium developer working on an unreleased feature

If you want to check how you feature behaves with browser-side navigation, run your tests with flag --enable-browser-side-navigation (keep in mind the known issues in content that may break the tests). If you find breakages and need advice on how to proceed to make your feature work with PlzNavigate enabled, please contact us.


Cool! Where do I start?

We're counting on your assistance to get your feature to support PlzNavigate. We prepared a document listing the areas known to us to have issues with PlzNavigate. But mind that systems/areas not mentioned there are not necessarily working and should be tested anyway (as described above). Just reach us at plzna...@chromium.org for more information.


Cheers,

The PlzNavigate team

Carlos Knippschild

unread,
Jan 11, 2016, 7:25:00 PM1/11/16
to Camille Lamy, chromium-dev
Sorry for the externally broken links. I fixed them in the text and listed them below:

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Reply all
Reply to author
Forward
0 new messages