2009-08-18 19:05:15 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set sw=2 ts=8 et tw=80 : */
|
|
|
|
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* The Mozilla Foundation
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2009
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Jason Duell <jduell.mcbugs@gmail.com>
|
2010-04-07 08:43:09 +00:00
|
|
|
* Daniel Witte <dwitte@mozilla.com>
|
2009-08-18 19:05:15 +00:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
#include "nsHttp.h"
|
|
|
|
#include "mozilla/net/NeckoChild.h"
|
2009-08-18 19:05:15 +00:00
|
|
|
#include "mozilla/net/HttpChannelChild.h"
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
|
|
|
|
#include "nsStringStream.h"
|
|
|
|
#include "nsHttpHandler.h"
|
|
|
|
#include "nsMimeTypes.h"
|
|
|
|
#include "nsNetUtil.h"
|
|
|
|
|
2009-08-18 19:05:15 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
|
|
|
// C++ file contents
|
|
|
|
HttpChannelChild::HttpChannelChild()
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
: mState(HCC_NEW)
|
2009-08-18 19:05:15 +00:00
|
|
|
{
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
LOG(("Creating HttpChannelChild @%x\n", this));
|
2009-08-18 19:05:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HttpChannelChild::~HttpChannelChild()
|
|
|
|
{
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
LOG(("Destroying HttpChannelChild @%x\n", this));
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::nsISupports
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2010-04-23 14:19:33 +00:00
|
|
|
// Override nsHashPropertyBag's AddRef: we don't need thread-safe refcnt
|
|
|
|
NS_IMPL_ADDREF(HttpChannelChild)
|
|
|
|
NS_IMPL_RELEASE_WITH_DESTROY(HttpChannelChild, RefcountHitZero())
|
|
|
|
|
|
|
|
void
|
|
|
|
HttpChannelChild::RefcountHitZero()
|
|
|
|
{
|
|
|
|
if (mWasOpened) {
|
|
|
|
// NeckoChild::DeallocPHttpChannel will delete this
|
|
|
|
PHttpChannelChild::Send__delete__(this);
|
|
|
|
} else {
|
|
|
|
delete this; // we never opened IPDL channel
|
|
|
|
}
|
|
|
|
}
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
|
|
|
|
NS_INTERFACE_MAP_BEGIN(HttpChannelChild)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIRequest)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIChannel)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIHttpChannel)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIHttpChannelInternal)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsICachingChannel)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIUploadChannel)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIUploadChannel2)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIEncodedChannel)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIResumableChannel)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISupportsPriority)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIProxiedChannel)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsITraceableChannel)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIApplicationCacheContainer)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIApplicationCacheChannel)
|
2010-04-07 08:43:09 +00:00
|
|
|
NS_INTERFACE_MAP_END_INHERITING(HttpBaseChannel)
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::PHttpChannelChild
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
bool
|
2010-03-23 15:14:36 +00:00
|
|
|
HttpChannelChild::RecvOnStartRequest(const nsHttpResponseHead& responseHead)
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
{
|
|
|
|
LOG(("HttpChannelChild::RecvOnStartRequest [this=%x]\n", this));
|
|
|
|
|
|
|
|
mState = HCC_ONSTART;
|
|
|
|
|
2010-03-23 15:14:36 +00:00
|
|
|
mResponseHead = new nsHttpResponseHead(responseHead);
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
|
2010-04-07 08:43:09 +00:00
|
|
|
nsresult rv = mListener->OnStartRequest(this, mListenerContext);
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
if (!NS_SUCCEEDED(rv)) {
|
|
|
|
// TODO: Cancel request:
|
|
|
|
// - Send Cancel msg to parent
|
|
|
|
// - drop any in flight OnDataAvail msgs we receive
|
|
|
|
// - make sure we do call OnStopRequest eventually
|
|
|
|
// - return true here, not false
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
HttpChannelChild::RecvOnDataAvailable(const nsCString& data,
|
|
|
|
const PRUint32& offset,
|
|
|
|
const PRUint32& count)
|
|
|
|
{
|
|
|
|
LOG(("HttpChannelChild::RecvOnDataAvailable [this=%x]\n", this));
|
|
|
|
|
|
|
|
mState = HCC_ONDATA;
|
|
|
|
|
|
|
|
// NOTE: the OnDataAvailable contract requires the client to read all the data
|
|
|
|
// in the inputstream. This code relies on that ('data' will go away after
|
|
|
|
// this function). Apparently the previous, non-e10s behavior was to actually
|
|
|
|
// support only reading part of the data, allowing later calls to read the
|
|
|
|
// rest.
|
|
|
|
nsCOMPtr<nsIInputStream> stringStream;
|
|
|
|
nsresult rv = NS_NewByteInputStream(getter_AddRefs(stringStream),
|
|
|
|
data.get(),
|
|
|
|
count,
|
|
|
|
NS_ASSIGNMENT_DEPEND);
|
|
|
|
if (!NS_SUCCEEDED(rv)) {
|
|
|
|
// TODO: what to do here? Cancel request? Very unlikely to fail.
|
|
|
|
return false;
|
|
|
|
}
|
2010-04-07 08:43:09 +00:00
|
|
|
rv = mListener->OnDataAvailable(this, mListenerContext,
|
|
|
|
stringStream, offset, count);
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
stringStream->Close();
|
|
|
|
if (!NS_SUCCEEDED(rv)) {
|
|
|
|
// TODO: Cancel request: see notes in OnStartRequest
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
HttpChannelChild::RecvOnStopRequest(const nsresult& statusCode)
|
|
|
|
{
|
|
|
|
LOG(("HttpChannelChild::RecvOnStopRequest [this=%x status=%u]\n",
|
|
|
|
this, statusCode));
|
|
|
|
|
|
|
|
mState = HCC_ONSTOP;
|
|
|
|
|
|
|
|
mIsPending = PR_FALSE;
|
|
|
|
mStatus = statusCode;
|
2010-04-07 08:43:09 +00:00
|
|
|
nsresult rv = mListener->OnStopRequest(this, mListenerContext, statusCode);
|
|
|
|
mListener = 0;
|
|
|
|
mListenerContext = 0;
|
2010-04-23 14:19:33 +00:00
|
|
|
|
|
|
|
// Corresponding AddRef in AsyncOpen().
|
|
|
|
this->Release();
|
|
|
|
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
if (!NS_SUCCEEDED(rv)) {
|
|
|
|
// TODO: Cancel request: see notes in OnStartRequest
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-05-13 17:28:51 +00:00
|
|
|
bool
|
|
|
|
HttpChannelChild::RecvOnProgress(const PRUint64& progress,
|
|
|
|
const PRUint64& progressMax)
|
|
|
|
{
|
|
|
|
LOG(("HttpChannelChild::RecvOnProgress [this=%p progress=%llu/%llu]\n",
|
|
|
|
this, progress, progressMax));
|
|
|
|
|
|
|
|
// cache the progress sink so we don't have to query for it each time.
|
|
|
|
if (!mProgressSink)
|
|
|
|
GetCallback(mProgressSink);
|
|
|
|
|
|
|
|
// block socket status event after Cancel or OnStopRequest has been called.
|
|
|
|
if (mProgressSink && NS_SUCCEEDED(mStatus) && mIsPending &&
|
|
|
|
!(mLoadFlags & LOAD_BACKGROUND))
|
|
|
|
{
|
|
|
|
if (progress > 0) {
|
|
|
|
NS_ASSERTION(progress <= progressMax, "unexpected progress values");
|
|
|
|
mProgressSink->OnProgress(this, nsnull, progress, progressMax);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
HttpChannelChild::RecvOnStatus(const nsresult& status,
|
|
|
|
const nsString& statusArg)
|
|
|
|
{
|
|
|
|
LOG(("HttpChannelChild::RecvOnStatus [this=%p status=%x]\n", this, status));
|
|
|
|
|
|
|
|
// cache the progress sink so we don't have to query for it each time.
|
|
|
|
if (!mProgressSink)
|
|
|
|
GetCallback(mProgressSink);
|
|
|
|
|
|
|
|
// block socket status event after Cancel or OnStopRequest has been called.
|
|
|
|
if (mProgressSink && NS_SUCCEEDED(mStatus) && mIsPending &&
|
|
|
|
!(mLoadFlags & LOAD_BACKGROUND))
|
|
|
|
{
|
|
|
|
mProgressSink->OnStatus(this, nsnull, status, statusArg.get());
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::nsIRequest
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2010-04-07 08:43:09 +00:00
|
|
|
HttpChannelChild::Cancel(nsresult status)
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
{
|
2010-03-28 01:53:46 +00:00
|
|
|
// FIXME: bug 536317
|
|
|
|
return NS_OK;
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::Suspend()
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::Resume()
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::nsIChannel
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetSecurityInfo(nsISupports **aSecurityInfo)
|
|
|
|
{
|
2010-03-28 01:53:46 +00:00
|
|
|
// FIXME: Stub for bug 536301 .
|
|
|
|
NS_ENSURE_ARG_POINTER(aSecurityInfo);
|
|
|
|
*aSecurityInfo = 0;
|
|
|
|
return NS_OK;
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::AsyncOpen(nsIStreamListener *listener, nsISupports *aContext)
|
|
|
|
{
|
|
|
|
LOG(("HttpChannelChild::AsyncOpen [this=%x uri=%s]\n", this, mSpec.get()));
|
|
|
|
|
|
|
|
NS_ENSURE_TRUE(gNeckoChild != nsnull, NS_ERROR_FAILURE);
|
|
|
|
NS_ENSURE_ARG_POINTER(listener);
|
|
|
|
NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
|
|
|
|
NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_ALREADY_OPENED);
|
|
|
|
|
|
|
|
// Port checked in parent, but duplicate here so we can return with error
|
2010-04-11 05:13:57 +00:00
|
|
|
// immediately
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
nsresult rv;
|
|
|
|
rv = NS_CheckPortSafety(mURI);
|
|
|
|
if (NS_FAILED(rv))
|
|
|
|
return rv;
|
|
|
|
|
2010-04-11 05:13:57 +00:00
|
|
|
// FIXME bug 562587: need to dupe nsHttpChannel::AsyncOpen cookies logic
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
|
2010-04-11 05:13:57 +00:00
|
|
|
// notify "http-on-modify-request" observers
|
|
|
|
gHttpHandler->OnModifyRequest(this);
|
|
|
|
|
|
|
|
mIsPending = PR_TRUE;
|
|
|
|
mWasOpened = PR_TRUE;
|
2010-04-07 08:43:09 +00:00
|
|
|
mListener = listener;
|
|
|
|
mListenerContext = aContext;
|
|
|
|
|
2010-04-11 05:13:57 +00:00
|
|
|
// add ourselves to the load group.
|
|
|
|
if (mLoadGroup)
|
|
|
|
mLoadGroup->AddRequest(this, nsnull);
|
|
|
|
|
|
|
|
// FIXME: bug 536317: We may have been cancelled already, either by
|
|
|
|
// on-modify-request listeners or by load group observers; in that case,
|
|
|
|
// don't create IPDL connection. See nsHttpChannel::AsyncOpen(): I think
|
|
|
|
// we'll need something like
|
|
|
|
//
|
|
|
|
// if (mCanceled) {
|
|
|
|
// LOG(("Calling AsyncAbort [rv=%x mCanceled=%i]\n", rv, mCanceled));
|
|
|
|
// AsyncAbort(rv);
|
|
|
|
// return NS_OK;
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// (This is assuming on-modify-request/loadgroup observers will still be able
|
|
|
|
// to cancel synchronously)
|
|
|
|
|
|
|
|
//
|
|
|
|
// Send request to the chrome process...
|
|
|
|
//
|
|
|
|
|
|
|
|
// FIXME: bug 558623: Combine constructor and SendAsyncOpen into one IPC msg
|
|
|
|
gNeckoChild->SendPHttpChannelConstructor(this);
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
|
2010-04-26 15:24:21 +00:00
|
|
|
SendAsyncOpen(IPC::URI(mURI), IPC::URI(mOriginalURI), IPC::URI(mDocumentURI),
|
|
|
|
IPC::URI(mReferrer), mLoadFlags, mRequestHeaders,
|
|
|
|
mRequestHead.Method(), mPriority, mRedirectionLimit,
|
|
|
|
mAllowPipelining, mForceAllowThirdPartyCookie);
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
|
2010-04-11 05:13:57 +00:00
|
|
|
// The socket transport layer in the chrome process now has a logical ref to
|
|
|
|
// us, until either OnStopRequest or OnRedirect is called.
|
|
|
|
this->AddRef();
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
|
2010-04-11 05:13:57 +00:00
|
|
|
mState = HCC_OPENED;
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::nsIHttpChannel
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::SetRequestHeader(const nsACString& aHeader,
|
|
|
|
const nsACString& aValue,
|
|
|
|
PRBool aMerge)
|
|
|
|
{
|
2010-04-07 08:43:09 +00:00
|
|
|
nsresult rv = HttpBaseChannel::SetRequestHeader(aHeader, aValue, aMerge);
|
2010-03-23 15:14:36 +00:00
|
|
|
if (NS_FAILED(rv))
|
|
|
|
return rv;
|
|
|
|
|
|
|
|
RequestHeaderTuple* tuple = mRequestHeaders.AppendElement();
|
|
|
|
if (!tuple)
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
|
|
|
|
tuple->mHeader = aHeader;
|
|
|
|
tuple->mValue = aValue;
|
|
|
|
tuple->mMerge = aMerge;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::nsIHttpChannelInternal
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::SetupFallbackChannel(const char *aFallbackKey)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::nsICachingChannel
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetCacheToken(nsISupports **aCacheToken)
|
|
|
|
{
|
2010-03-28 01:53:46 +00:00
|
|
|
// FIXME: stub for bug 537164
|
|
|
|
return NS_ERROR_NOT_AVAILABLE;
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::SetCacheToken(nsISupports *aCacheToken)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetOfflineCacheToken(nsISupports **aOfflineCacheToken)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::SetOfflineCacheToken(nsISupports *aOfflineCacheToken)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetCacheKey(nsISupports **aCacheKey)
|
|
|
|
{
|
2010-03-28 01:53:46 +00:00
|
|
|
// FIXME: stub for bug 537164
|
|
|
|
NS_ENSURE_ARG_POINTER(aCacheKey);
|
|
|
|
*aCacheKey = 0;
|
|
|
|
return NS_OK;
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::SetCacheKey(nsISupports *aCacheKey)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetCacheAsFile(PRBool *aCacheAsFile)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::SetCacheAsFile(PRBool aCacheAsFile)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetCacheForOfflineUse(PRBool *aCacheForOfflineUse)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::SetCacheForOfflineUse(PRBool aCacheForOfflineUse)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetOfflineCacheClientID(nsACString& id)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::SetOfflineCacheClientID(const nsACString& id)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetCacheFile(nsIFile **aCacheFile)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2010-03-28 01:53:46 +00:00
|
|
|
HttpChannelChild::IsFromCache(PRBool *value)
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
{
|
2010-03-28 01:53:46 +00:00
|
|
|
if (!mIsPending)
|
|
|
|
return NS_ERROR_NOT_AVAILABLE;
|
|
|
|
|
|
|
|
// FIXME: stub for bug 537164
|
|
|
|
*value = false;
|
|
|
|
return NS_OK;
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::nsIUploadChannel
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::SetUploadStream(nsIInputStream *aStream,
|
|
|
|
const nsACString& aContentType,
|
|
|
|
PRInt32 aContentLength)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2010-03-28 01:53:46 +00:00
|
|
|
HttpChannelChild::GetUploadStream(nsIInputStream **stream)
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
{
|
2010-03-28 01:53:46 +00:00
|
|
|
// FIXME: stub for bug 536273
|
|
|
|
NS_ENSURE_ARG_POINTER(stream);
|
|
|
|
*stream = 0;
|
|
|
|
return NS_OK;
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::nsIUploadChannel2
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::ExplicitSetUploadStream(nsIInputStream *aStream,
|
|
|
|
const nsACString& aContentType,
|
|
|
|
PRInt64 aContentLength,
|
|
|
|
const nsACString& aMethod,
|
|
|
|
PRBool aStreamHasHeaders)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::nsIEncodedChannel
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetContentEncodings(nsIUTF8StringEnumerator **result)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* attribute boolean applyConversion; */
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetApplyConversion(PRBool *aApplyConversion)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::SetApplyConversion(PRBool aApplyConversion)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::nsIResumableChannel
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::ResumeAt(PRUint64 startPos, const nsACString& entityID)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetEntityID(nsACString& aEntityID)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::nsISupportsPriority
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::SetPriority(PRInt32 aPriority)
|
|
|
|
{
|
2010-04-11 04:53:35 +00:00
|
|
|
PRInt16 newValue = CLAMP(aPriority, PR_INT16_MIN, PR_INT16_MAX);
|
|
|
|
if (mPriority == newValue)
|
|
|
|
return NS_OK;
|
|
|
|
mPriority = newValue;
|
|
|
|
if (mWasOpened)
|
|
|
|
SendSetPriority(mPriority);
|
|
|
|
return NS_OK;
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::nsIProxiedChannel
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetProxyInfo(nsIProxyInfo **aProxyInfo)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::nsITraceableChannel
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::SetNewListener(nsIStreamListener *listener,
|
|
|
|
nsIStreamListener **oldListener)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::nsIApplicationCacheContainer
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetApplicationCache(nsIApplicationCache **aApplicationCache)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::SetApplicationCache(nsIApplicationCache *aApplicationCache)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// HttpChannelChild::nsIApplicationCacheChannel
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetLoadedFromApplicationCache(PRBool *retval)
|
|
|
|
{
|
2010-03-28 01:53:46 +00:00
|
|
|
// FIXME: stub for bug 536295
|
|
|
|
*retval = 0;
|
|
|
|
return NS_OK;
|
Bug 530952: Electrolysis HTTP Channel implementation. author=jduell, r=bsmedberg, sr=bz
- Supports only primitive xpcshell HTTP requests which don't set/get HTTP
headers, don't do redirects, observers, load groups, or anything else other
than basic things like looking at the reply body, Content-type, Content-length, etc.
- Tested with network/test/unit_ipc/test_simple_wrap.js (patch @ bug 521922)
- Only used if "NECKO_E10S_HTTP" set in environment.
- Force http.h to get #included before any IPDL files, to centralize #define
handling of LOG and to make sure FORCE_PR_LOGGING is set if needed (bug
545995)
2009-09-22 18:55:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetInheritApplicationCache(PRBool *aInheritApplicationCache)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::SetInheritApplicationCache(PRBool aInheritApplicationCache)
|
|
|
|
{
|
|
|
|
// FIXME: Browser calls this early, so stub OK for now. Fix in bug 536295.
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::GetChooseApplicationCache(PRBool *aChooseApplicationCache)
|
|
|
|
{
|
|
|
|
DROP_DEAD();
|
|
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
|
|
HttpChannelChild::SetChooseApplicationCache(PRBool aChooseApplicationCache)
|
|
|
|
{
|
|
|
|
// FIXME: Browser calls this early, so stub OK for now. Fix in bug 536295.
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2009-08-18 19:05:15 +00:00
|
|
|
}} // mozilla::net
|
|
|
|
|