Stop reference counting BrowserContext

Bug #1503639 reported by Chris Coulson on 2015-10-07
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Chris Coulson
Chris Coulson

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)

Changed in oxide:
importance: Undecided → Low
status: New → Triaged
Changed in oxide:
status: Triaged → In Progress
assignee: nobody → Chris Coulson (chrisccoulson)
Changed in oxide:
milestone: none → branch-1.19
Changed in oxide:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers