[tor-commits] [torbutton/master] Remove some JavaScript Debugger exception spam.

mikeperry at torproject.org mikeperry at torproject.org
Thu Jan 17 01:18:05 UTC 2013


commit 9c15f4a7562ee85cbdc03f546883efd59e85c06d
Author: Mike Perry <mikeperry-git at fscked.org>
Date:   Tue Jan 15 22:20:20 2013 -0800

    Remove some JavaScript Debugger exception spam.
---
 src/components/external-app-blocker.js |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/components/external-app-blocker.js b/src/components/external-app-blocker.js
index 4605d9e..91f0483 100644
--- a/src/components/external-app-blocker.js
+++ b/src/components/external-app-blocker.js
@@ -30,6 +30,7 @@ const kExternalInterfaces = ["nsIObserver", "nsIMIMEService",
                              
 const kREAL_DRAG_CID = "{8b5314bb-db01-11d2-96ce-0060b0fb9956}";
 const kDragInterfaces = ["nsIDragService"];
+                        //, "nsIDragSession"];
 
 const Cr = Components.results;
 const Cc = Components.classes;
@@ -81,12 +82,21 @@ ExternalWrapper.prototype =
       return this;
     }
 
-    try {
-      var external = this._external().QueryInterface(iid);
-      this.copyMethods(external);
-    } catch(e) {
+    /* We perform this explicit check first because otherwise
+     * the JSD exception logs are full of noise */
+    if (iid.equals(Components.interfaces.nsIDragService)
+        || iid.equals(Components.interfaces.nsIDragSession)) {
       var drag = this._drag().QueryInterface(iid);
       this.copyMethods(drag);
+    } else {
+      try {
+        var external = this._external().QueryInterface(iid);
+        this.copyMethods(external);
+      } catch(e) {
+        this.logger.log(3, "Drag+drop QI: "+iid);
+        var drag = this._drag().QueryInterface(iid);
+        this.copyMethods(drag);
+      }
     }
     return this;
   },





More information about the tor-commits mailing list