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

Delta Between Two Patch Sets: lib/utils.js

Issue 29329742: Issue 3251 - Simplify messaging from child scripts to parent (Closed)
Left Patch Set: Created Nov. 4, 2015, 2:58 p.m.
Right Patch Set: Rebased Created Nov. 12, 2015, 12:29 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« lib/child/bootstrap.js ('K') | « lib/requestNotifier.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 556
557 if (callbackID) 557 if (callbackID)
558 { 558 {
559 let target = message.target.QueryInterface(Ci.nsIMessageSender); 559 let target = message.target.QueryInterface(Ci.nsIMessageSender);
560 target.sendAsyncMessage("AdblockPlus:Response", { 560 target.sendAsyncMessage("AdblockPlus:Response", {
561 callbackID, 561 callbackID,
562 response 562 response
563 }); 563 });
564 } 564 }
565 else 565 else
566 return JSON.stringify(response); 566 return response;
567 }; 567 };
568 messageManager.addMessageListener(messageName, wrapper); 568 messageManager.addMessageListener(messageName, wrapper);
569 onShutdown.add(() => messageManager.removeMessageListener(messageName, wrapp er)); 569 onShutdown.add(() => messageManager.removeMessageListener(messageName, wrapp er));
570 } 570 }
571 }; 571 };
572 572
573 /** 573 /**
574 * A cache with a fixed capacity, newer entries replace entries that have been 574 * A cache with a fixed capacity, newer entries replace entries that have been
575 * stored first. 575 * stored first.
576 * @constructor 576 * @constructor
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 Cu.reportError(e); 820 Cu.reportError(e);
821 // Expected, ctypes isn't supported in Gecko 1.9.2 821 // Expected, ctypes isn't supported in Gecko 1.9.2
822 return null; 822 return null;
823 } 823 }
824 }); 824 });
825 825
826 if ("@mozilla.org/messenger/headerparser;1" in Cc) 826 if ("@mozilla.org/messenger/headerparser;1" in Cc)
827 XPCOMUtils.defineLazyServiceGetter(Utils, "headerParser", "@mozilla.org/messen ger/headerparser;1", "nsIMsgHeaderParser"); 827 XPCOMUtils.defineLazyServiceGetter(Utils, "headerParser", "@mozilla.org/messen ger/headerparser;1", "nsIMsgHeaderParser");
828 else 828 else
829 Utils.headerParser = null; 829 Utils.headerParser = null;
LEFTRIGHT

Powered by Google App Engine
This is Rietveld