← Back to team overview

ubuntu-webapps-bugs team mailing list archive

[Bug 1503639] [NEW] Stop reference counting BrowserContext

 

Public bug reported:

BrowserContext is currently reference counted, with WebContext holding a
reference and WebViewContentsHelper holding a reference for each
WebContents. We currently use base::RefCountedThreadSafe in order to
customize the delete behaviour (BrowserContext is deleted via
BrowserContextDestroyer, to ensure it outlives any RenderProcessHosts),
but this is confusing because the class isn't thread safe (it also uses
base::NonThreadSafe and we assert on most entry points that they are
called on the UI thread).

We should stop reference counting it and have WebContext own it
exclusively. BrowserContextDestroyer should then ensure it outlives any
WebContents. Any classes that want to reference a BrowserContext should
either implement BrowserContextObserver (which provides a notification
when it's deleted) or use BrowserContextID (and we could provide a
helper to map between BrowserContextID and BrowserContext)

** Affects: oxide
     Importance: Low
         Status: Triaged

** Changed in: oxide
   Importance: Undecided => Low

** Changed in: oxide
       Status: New => Triaged

-- 
You received this bug notification because you are a member of Ubuntu
WebApps bug tracking, which is subscribed to Oxide.
https://bugs.launchpad.net/bugs/1503639

Title:
  Stop reference counting BrowserContext

Status in Oxide:
  Triaged

Bug description:
  BrowserContext is currently reference counted, with WebContext holding
  a reference and WebViewContentsHelper holding a reference for each
  WebContents. We currently use base::RefCountedThreadSafe in order to
  customize the delete behaviour (BrowserContext is deleted via
  BrowserContextDestroyer, to ensure it outlives any
  RenderProcessHosts), but this is confusing because the class isn't
  thread safe (it also uses base::NonThreadSafe and we assert on most
  entry points that they are called on the UI thread).

  We should stop reference counting it and have WebContext own it
  exclusively. BrowserContextDestroyer should then ensure it outlives
  any WebContents. Any classes that want to reference a BrowserContext
  should either implement BrowserContextObserver (which provides a
  notification when it's deleted) or use BrowserContextID (and we could
  provide a helper to map between BrowserContextID and BrowserContext)

To manage notifications about this bug go to:
https://bugs.launchpad.net/oxide/+bug/1503639/+subscriptions


Follow ups