Last Comment Bug 675068 - change off-thread cycle collection to not use a safe JS context
: change off-thread cycle collection to not use a safe JS context
Product: Core
Classification: Components
Component: XPConnect (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla8
Assigned To: Luke Wagner [:luke]
Depends on:
Blocks: 650411
  Show dependency treegraph
Reported: 2011-07-28 15:37 PDT by Luke Wagner [:luke]
Modified: 2011-08-04 07:02 PDT (History)
5 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (6.47 KB, patch)
2011-07-28 15:37 PDT, Luke Wagner [:luke]
mrbkap: review+
peterv: review+
Details | Diff | Review
rm unused XPCallContext::GetSafeJSContext (2.02 KB, patch)
2011-08-01 14:54 PDT, Luke Wagner [:luke]
mrbkap: review+
Details | Diff | Review

Description Luke Wagner [:luke] 2011-07-28 15:37:39 PDT
Created attachment 549249 [details] [diff] [review]

When doing cycle-collection off the main thread, XPConnect calls GetSafeJSContext.  This creates a JSContext, associated with the main-thread JSRuntime, that is owned and later destroyed concurrently (when the cycle collection thread is destroyed).  This patch creates a special context to use just for cycle collection that gets destroyed on the main thread during shutdown.  This is enough to satisfy the asserts in bug 650411.  Later, (after we can assume single-threaded XPConnect) we can rip this out.
Comment 1 Luke Wagner [:luke] 2011-08-01 14:54:05 PDT
Created attachment 549935 [details] [diff] [review]
rm unused XPCallContext::GetSafeJSContext

Found this dead code while in the area.  Its nice not to have it since it makes it easier to reason about safe JS contexts.
Comment 2 Luke Wagner [:luke] 2011-08-03 12:27:42 PDT
Comment on attachment 549249 [details] [diff] [review]

One review is probably enough; also I think peterv's out.
Comment 5 Peter Van der Beken [:peterv] 2011-08-04 07:02:35 PDT
Comment on attachment 549249 [details] [diff] [review]

Review of attachment 549249 [details] [diff] [review]:

Fine by me.

Note You need to log in before you can comment on or make changes to this bug.