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: Created Nov. 17, 2016, 1:17 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
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 {

Powered by Google App Engine
This is Rietveld