Closed Bug 1382679 Opened 8 years ago Closed 8 years ago

runtime.sendMessage(), make possible to clone references at least in its extension

Categories

(WebExtensions :: Untriaged, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: 21Naown, Unassigned)

Details

I saw bug 1370752 and bug 1356546, I do not know really if they are related to this bug. For "runtime.sendMessage()", is it possible to make the cloning of references at least in its extension (to its popup for example)? Here is a simple and not optimized (but faster to understand) example: mapOne = new Map(); mapOne.set(0, {id: 0, arrayReferenceToThisObject: []}; mapTwo = new Map(); mapTwo.set(55, {id: 55, referenceInMapOne: mapOne.get(0)}; mapThree = new Map(); mapThree.set(77, {id: 77, referenceInMapOne: mapOne.get(0)}; mapOne.get(0).arrayReferenceToThisObject.push(mapTwo.get(55)); mapOne.get(0).arrayReferenceToThisObject.push(mapThree.get(77)); It will save CPU cycles instead of, for example as "workaround" or possible solution, copying the objects (here Map) instead of references and adding code to handle them.
sendMessage works by cloning. If you want to share objects between extension pages, there are other ways of doing so.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.