Examples of nsIHttpChannel


Examples of org.mozilla.interfaces.nsIHttpChannel

  {
    try
    {
      if( getUrl() != null && !getUrl().equals( "about:blank" ) )
      {
        nsIHttpChannel ch = null;

        ch = ( nsIHttpChannel )request.queryInterface( nsIHttpChannel.NS_IHTTPCHANNEL_IID );

        if( ch != null )
        {
View Full Code Here

Examples of org.mozilla.interfaces.nsIHttpChannel

  {
    try
    {
      if( getUrl() != null && !getUrl().equals( "about:blank" ) )
      {
        nsIHttpChannel ch = null;

        ch = ( nsIHttpChannel )arg1.queryInterface( nsIHttpChannel.NS_IHTTPCHANNEL_IID );

        if( ch != null )
        {
View Full Code Here

Examples of org.mozilla.interfaces.nsIHttpChannel

        {
          try
          {
            if( EVENT_HTTP_ON_MODIFY_REQUEST.equals( sTopic ) )
            {
              nsIHttpChannel httpChannel = ( nsIHttpChannel )subject
                  .queryInterface( nsIHttpChannel.NS_IHTTPCHANNEL_IID );

              if( httpChannel.getNotificationCallbacks() == null )
                return;

              nsIInterfaceRequestor interfaceRequestor = ( nsIInterfaceRequestor )httpChannel
                  .getNotificationCallbacks()
                  .queryInterface( nsIInterfaceRequestor.NS_IINTERFACEREQUESTOR_IID );

              nsIDOMWindow window = ( nsIDOMWindow )interfaceRequestor
                  .getInterface( nsIDOMWindow.NS_IDOMWINDOW_IID );

              BrowserComponent browserComponent = browserMap.get( window );
              if( browserComponent != null && browserRecordingMap.containsKey( browserComponent ) )
              {
                RecordedRequest rr = new RecordedRequest( dumpUri( httpChannel.getURI() ),
                    httpChannel.getRequestMethod() );

                nsIUploadChannel upload = ( nsIUploadChannel )httpChannel
                    .queryInterface( nsIUploadChannel.NS_IUPLOADCHANNEL_IID );

                byte[] requestData = null;
                if( upload != null )
                {
                  nsIInputStream uploadStream = upload.getUploadStream();

                  if( uploadStream != null && uploadStream.available() > 0 )
                  {
                    nsISeekableStream seekable = ( nsISeekableStream )uploadStream
                        .queryInterface( nsISeekableStream.NS_ISEEKABLESTREAM_IID );

                    long pos = seekable.tell();
                    long available = uploadStream.available();

                    if( available > 0 )
                    {
                      try
                      {
                        synchronized( mozilla )
                        {
                          in.setInputStream( uploadStream );
                          requestData = in.readByteArray( available );
                          String requestBody = getRequestBody( requestData );
                          if( requestBody != null && requestBody.length() > 0 )
                          {
                            rr.setContent( requestBody );
                            String contentType = getContentType( requestData );
                            if( StringUtils.hasContent( contentType ) )
                              rr.setContentType( contentType );
                          }
                        }
                      }
                      catch( Throwable e )
                      {
                        e.printStackTrace();
                      }
                      finally
                      {
                        seekable.seek( nsISeekableStream.NS_SEEK_SET, pos );
                      }
                    }
                  }
                }

                final StringToStringsMap headersMap = new StringToStringsMap();
                httpChannel.visitRequestHeaders( new nsIHttpHeaderVisitor()
                {

                  public void visitHeader( String header, String value )
                  {
                    if( !isHeaderExcluded( header ) )
View Full Code Here

Examples of org.mozilla.interfaces.nsIHttpChannel

  {
    try
    {
      if( getUrl() != null && !getUrl().equals( "about:blank" ) )
      {
        nsIHttpChannel ch = null;

        ch = ( nsIHttpChannel )request.queryInterface( nsIHttpChannel.NS_IHTTPCHANNEL_IID );

        if( ch != null )
        {
View Full Code Here

Examples of org.mozilla.interfaces.nsIHttpChannel

  {
    try
    {
      if( getUrl() != null && !getUrl().equals( "about:blank" ) )
      {
        nsIHttpChannel ch = null;

        ch = ( nsIHttpChannel )arg1.queryInterface( nsIHttpChannel.NS_IHTTPCHANNEL_IID );

        if( ch != null )
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.