Bug 1287007 - Enable proxying of most APIs. r=billm
authorRob Wu <rob@robwu.nl>
Mon, 12 Sep 2016 21:19:53 -0700
changeset 349176 851e08a1f368c42fcbe0f1522f22e36690dba0ae
parent 349175 44c68913ebf56daf3aef3454c615597fef3d62b9
child 349177 b07b3ad62e31cad6ece15192d2d61965c0ac186d
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1287007
milestone52.0a1
Bug 1287007 - Enable proxying of most APIs. r=billm MozReview-Commit-ID: KrI42XrsVVG
toolkit/components/extensions/ExtensionChild.jsm
--- a/toolkit/components/extensions/ExtensionChild.jsm
+++ b/toolkit/components/extensions/ExtensionChild.jsm
@@ -107,21 +107,24 @@ class WannabeChildAPIManager extends Chi
     proxyContext.setContentWindow(this.context.contentWindow);
 
     // Synchronously unload the ProxyContext because we synchronously create it.
     this.context.callOnClose({close: proxyContext.unload.bind(proxyContext)});
   }
 
   getFallbackImplementation(namespace, name) {
     // This is gross and should be removed ASAP.
-    let shouldSynchronouslyUseParentAPI = true;
-    // The test API is known to be fully compatible with webext-oop,
-    // except for events due to bugzil.la/1300234
-    if (namespace == "test" && name != "onMessage") {
-      shouldSynchronouslyUseParentAPI = false;
+    let shouldSynchronouslyUseParentAPI = false;
+    // Incompatible APIs are listed here.
+    if (namespace == "runtime" && name == "connectNative" || // Returns a custom Port.
+        namespace == "runtime" && name == "sendNativeMessage" || // Fix together with connectNative.
+        namespace == "tabs" && name == "onRemoved" || // bugzil.la/1300234
+        namespace == "webNavigation" || // ChildAPIManager is oblivious to filters.
+        namespace == "webRequest") { // Incompatible by design (synchronous).
+      shouldSynchronouslyUseParentAPI = true;
     }
     if (shouldSynchronouslyUseParentAPI) {
       let proxyContext = ParentAPIManager.proxyContexts.get(this.id);
       let apiObj = findPathInObject(proxyContext.apiObj, namespace, false);
       if (apiObj && name in apiObj) {
         return new LocalAPIImplementation(apiObj, name, this.context);
       }
       // If we got here, then it means that the JSON schema claimed that the API