Re: Enterprise Watermarking Navigation

293 views
Skip to first unread message

Khushal Sagar

unread,
May 29, 2024, 12:04:21 PMMay 29
to navigation-dev, Khushal Sagar, alsh...@google.com, Graphics-dev
I should add, this means we'd have the watermark on the old Document's content for the duration of paint holding. But I don't see an easy way to fix that, paint holding happens pretty low in the Viz stack after the native view tree/compositor layer tree has already switched to the new Document. It's hard to tie other content in the UI (like the watermark view) to which viz::Surface is being rendered for a native view in the browser UI.

On Wednesday, May 29, 2024 at 11:27:03 a.m. UTC-4 Khushal Sagar wrote:
Have you considered adding the watermark view as a child of the primary main frame's RenderWidgetHostView's native view? You can use DidFinishNavigation to track when a new navigation commits in the primary main frame, then access the newly committed primary main frame's RenderWidgetHostView here. The watermark view can be a child of the RWHV's native view directly. This will tie the watermark directly to the web page's view in the tree so it will draw exactly when the browser swaps the committed Document.

On Tuesday, May 28, 2024 at 11:06:52 AM UTC-4 alsh...@google.com wrote:
I am currently working on enterprise watermarking, and not able to figure out at what point to draw the watermark. Currently, we opt for a conservative approach, using a web content navigation observer to draw the watermark early and clear it late. Here are some pointers to the relevant source code:

  • Constructing the navigation observer in the DidStartNavigation() callback
  • Drawing the watermark immediately after receiving a safebrowsing verdict, before the document load starts, if it is non-empty. If it is empty, we set `clear_watermark_text_on_page_load_` to true so that we clear it on page load.
  • Clearing the watermark in the DocumentOnLoadCompletedInPrimaryMainFrame callback, if required.  
What we'd like to do is draw the watermark at the exact time the new document replaces the old one. Can we achieve this using a combination of navigation observer/throttle instances?

Thanks,
Nasser
Reply all
Reply to author
Forward
0 new messages