Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/child/nodeInfo.js

Issue 29363476: Issue 2879 - Move element selection into the content process (Closed) Base URL: https://hg.adblockplus.org/elemhidehelper
Patch Set: Addressed comments and marked extension as E10S-compatible Created Nov. 24, 2016, 2 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/child/main.js ('k') | lib/child/selection.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/child/nodeInfo.js
===================================================================
--- a/lib/child/nodeInfo.js
+++ b/lib/child/nodeInfo.js
@@ -3,38 +3,20 @@
* version 2.0 (the "License"). You can obtain a copy of the License at
* http://mozilla.org/MPL/2.0/.
*/
"use strict";
let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
-let messageManager = require("messageManager");
-
let processID = Services.appinfo.processID;
let maxNodeID = 0;
let nodes = new Map();
-messageManager.addMessageListener("ElemHideHelper:GetNodeInfo", onGetNodeInfo);
-onShutdown.add(() =>
-{
- messageManager.removeMessageListener("ElemHideHelper:GetNodeInfo", onGetNodeInfo);
-});
-
-function onGetNodeInfo(message)
-{
- if (Cu.isCrossProcessWrapper(message.objects.element))
- return;
-
- let nodeInfo = getNodeInfo(message.objects.element);
- nodeInfo.messageId = message.data;
- messageManager.sendAsyncMessage("ElemHideHelper:GetNodeInfo:Response", nodeInfo);
-}
-
function getNodeInfo(node)
{
let nodeData = getNodeData(node);
if (nodeData)
{
let nodeID = processID + "-" + (++maxNodeID);
nodes.set(nodeID, {document: node.ownerDocument, style: null});
return {
« no previous file with comments | « lib/child/main.js ('k') | lib/child/selection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld