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

Delta Between Two Patch Sets: toolkit/components/extensions/ext-c-runtime.js

Issue 29863604: Issue 6865 - Update ABP dependency to version 3.2 (Closed)
Left Patch Set: Created Aug. 24, 2018, 8:38 p.m.
Right Patch Set: Adjusting code style Created Jan. 16, 2019, 1:45 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
« no previous file with change/comment | « mobile/android/chrome/content/browser.js ('k') | toolkit/components/extensions/schemas/runtime.json » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 "use strict"; 1 "use strict";
2 2
3 Components.utils.import("resource://gre/modules/Messaging.jsm"); 3 Components.utils.import("resource://gre/modules/Messaging.jsm");
4 4
5 this.runtime = class extends ExtensionAPI { 5 this.runtime = class extends ExtensionAPI {
6 getAPI(context) { 6 getAPI(context) {
7 let {extension} = context; 7 let {extension} = context;
8 8
9 return { 9 return {
10 runtime: { 10 runtime: {
11 11
12 // Added functions in order to make possible the communication between 12 // Added functions in order to make possible the communication between
13 // the Android part and the extension. 13 // the Android part and the extension.
14 // See https://issues.adblockplus.org/ticket/6865 14 // See https://issues.adblockplus.org/ticket/6865
15 abbRegisterRequestListener: function(listener) { 15 registerAbbMessageListener: function(listener) {
16 EventDispatcher.instance.registerListener((event, data, callback) => 16 EventDispatcher.instance.registerListener((event, data, callback) =>
17 { 17 {
18 let result = context.runSafe(listener, data); 18 let result = context.runSafe(listener, data);
19 if (result["success"]) { 19 if (result["success"]) {
20 callback.onSuccess(result); 20 callback.onSuccess(result);
21 } else { 21 } else {
22 let errorMsg = result["error"] ? result["error"] : "An error has o curred"; 22 let errorMsg = result["error"] ? result["error"] : "An error has o curred";
23 callback.onError(errorMsg); 23 callback.onError(errorMsg);
24 } 24 }
25 }, "Abb:Api"); 25 }, "Abb:Api");
26 }, 26 },
27 abbSendRequest: function(type) { 27 sendAbbMessage: function(type) {
28 EventDispatcher.instance.sendRequest({"type": type}); 28 EventDispatcher.instance.sendRequest({"type": "Abb:" + type});
29 }, 29 },
30 30
31 onConnect: context.messenger.onConnect("runtime.onConnect"), 31 onConnect: context.messenger.onConnect("runtime.onConnect"),
32 32
33 onMessage: context.messenger.onMessage("runtime.onMessage"), 33 onMessage: context.messenger.onMessage("runtime.onMessage"),
34 34
35 onConnectExternal: context.messenger.onConnectExternal("runtime.onConnec tExternal"), 35 onConnectExternal: context.messenger.onConnectExternal("runtime.onConnec tExternal"),
36 36
37 onMessageExternal: context.messenger.onMessageExternal("runtime.onMessag eExternal"), 37 onMessageExternal: context.messenger.onMessageExternal("runtime.onMessag eExternal"),
38 38
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 id: extension.id, 143 id: extension.id,
144 144
145 getURL: function(url) { 145 getURL: function(url) {
146 return extension.baseURI.resolve(url); 146 return extension.baseURI.resolve(url);
147 }, 147 },
148 }, 148 },
149 }; 149 };
150 } 150 }
151 }; 151 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld