Closed Bug 1160910 Opened 5 years ago Closed 3 years ago

[e10s] Can not visit headers on nsIHttpChannel object

Categories

(Core :: General, defect)

39 Branch
x86_64
Linux
defect
Not set

Tracking

()

RESOLVED WONTFIX
Tracking Status
e10s + ---

People

(Reporter: pzhang, Unassigned)

References

Details

(Whiteboard: [shims])

+++ This bug was initially created as a clone of Bug #1081879 +++

Let's file a separate bug here for https://bugzilla.mozilla.org/show_bug.cgi?id=1081879#c7

Error occured when visiting headers on the nsIHttpChannel object if e10s mode is enabled:
  [object CPOW [Exception... "It's illegal to pass a CPOW to native code arg 0 [nsIHttpChannel.visitRequestHeaders]"  nsresult: "0x80570036 (NS_ERROR_XPC_CANT_PASS_CPOW_TO_NATIVE)"  location: "JS frame :: chrome://global/content/browser-child.js :: _send :: line 105"  data: no]]

here is the code to reproduce it:
  gBrowser.addTabsProgressListener({
    onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
      if (!(aStateFlags & (Ci.nsIWebProgressListener.STATE_TRANSFERRING | Ci.nsIWebProgressListener.STATE_IS_DOCUMENT))) {
        return;
      }

      let httpChannel = aRequest.QueryInterface(Ci.nsIHttpChannel);
      httpChannel.visitRequestHeaders({
        visitHeader: function(aHeader, aValue) {
          console.log(aHeader + ': ' + aValue);
        }
      });
    }
  });
No longer depends on: 1160217
Whiteboard: [shims]
This needs to be done in the process that the channel belongs to rather than relying on shims.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.