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

Unified Diff: lib/dataCollector.js

Issue 29338283: Issue 3499 - Use the new messaging API for the issue reporter (Closed)
Patch Set: Created March 15, 2016, 10:57 a.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/dataCollector.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dataCollector.js
===================================================================
deleted file mode 100644
--- a/lib/dataCollector.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file is part of Adblock Plus <https://adblockplus.org/>,
- * Copyright (C) 2006-2016 Eyeo GmbH
- *
- * Adblock Plus is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
- *
- * Adblock Plus is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
- * @fileOverview Collects some data for a content window, to be attached to
- * issue reports.
- */
-
-"use strict";
-
-let {Utils} = require("utils");
-
-let maxResponseID = 0;
-let callbacks = new Map();
-
-let messageManager = Cc["@mozilla.org/parentprocessmessagemanager;1"]
- .getService(Ci.nsIMessageListenerManager)
- .QueryInterface(Ci.nsIMessageBroadcaster);
-
-Utils.addChildMessageListener("AdblockPlus:CollectDataResponse", onResponse);
-
-function onResponse({responseID, data})
-{
- let callback = callbacks.get(responseID);
- callbacks.delete(responseID);
- if (typeof callback == "function")
- callback(data);
-}
-
-/**
- * Collects data for the given window.
- * @param {number} outerWindowID the ID of the window
- * @param {number} screenshotWidth width of the screenshot to be created
- * @param {Function} callback function to be called with the data
- */
-function collectData(outerWindowID, screenshotWidth, callback)
-{
- let id = ++maxResponseID;
- callbacks.set(id, callback);
-
- messageManager.broadcastAsyncMessage("AdblockPlus:CollectData", {
- outerWindowID,
- screenshotWidth,
- responseID: id
- });
-}
-exports.collectData = collectData;
« no previous file with comments | « lib/child/dataCollector.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld