Components.utils.reportError(ex); 
  openInExternalEditor: function(aURL, aPageDescriptor, aDocument, aCallBack)  {    var data = {url: aURL, pageDescriptor: aPageDescriptor, doc: aDocument};    try {      var editor = this.getExternalViewSourceEditor();          if (!editor) {        this.handleCallBack(aCallBack, false, data);        return;      }      // make a uri      var ios = Components.classes["@mozilla.org/network/io-service;1"]                          .getService(Components.interfaces.nsIIOService);      var charset = aDocument ? aDocument.characterSet : null;      var uri = ios.newURI(aURL, charset, null);      data.uri = uri;      var path;      var contentType = aDocument ? aDocument.contentType : null;      if (uri.scheme == "file") {            // it's a local file; we can open it directly        path = uri.QueryInterface(Components.interfaces.nsIFileURL).file.path;        editor.run(false, [path], 1);        this.handleCallBack(aCallBack, true, data);      } else {        // set up the progress listener with what we know so far        this.viewSourceProgressListener.editor = editor;        this.viewSourceProgressListener.callBack = aCallBack;        this.viewSourceProgressListener.data = data;              if (!aPageDescriptor) {          // without a page descriptor, loadPage has no chance of working. download the file.          var file = this.getTemporaryFile(uri, aDocument, contentType);          this.viewSourceProgressListener.file = file;          var webBrowserPersist = Components                                  .classes["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]                                  .createInstance(this.mnsIWebBrowserPersist);          // the default setting is to not decode. we need to decode.          webBrowserPersist.persistFlags = this.mnsIWebBrowserPersist.PERSIST_FLAGS_REPLACE_EXISTING_FILES;          webBrowserPersist.progressListener = this.viewSourceProgressListener;          webBrowserPersist.saveURI(uri, null, null, null, null, file);        } else {          // we'll use nsIWebPageDescriptor to get the source because it may not have to refetch          // the file from the server          var webShell = Components.classes["@mozilla.org/webshell;1"].createInstance();          this.viewSourceProgressListener.webShell = webShell;          var progress = webShell.QueryInterface(this.mnsIWebProgress);          progress.addProgressListener(this.viewSourceProgressListener,                                       this.mnsIWebProgress.NOTIFY_STATE_DOCUMENT);          var pageLoader = webShell.QueryInterface(this.mnsIWebPageDescriptor);              pageLoader.loadPage(aPageDescriptor, this.mnsIWebPageDescriptor.DISPLAY_AS_SOURCE);        }      }    } catch (ex) {      // we failed loading it with the external editor.      this.handleCallBack(aCallBack, false, data);      return;    }  },
5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5872/4424ceee06a31dfcd9fb69d6502773db17ae471d/viewSourceUtils.js/buggy/toolkit/components/viewsource/content/viewSourceUtils.js