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 : */
|
|
|
|
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
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
|
|
|
#include "nsHttp.h"
|
2009-08-18 19:05:15 +00:00
|
|
|
#include "mozilla/net/NeckoParent.h"
|
|
|
|
#include "mozilla/net/HttpChannelParent.h"
|
2010-03-25 23:02:28 +00:00
|
|
|
#include "mozilla/net/CookieServiceParent.h"
|
2010-10-11 11:35:10 +00:00
|
|
|
#include "mozilla/net/WyciwygChannelParent.h"
|
2010-08-10 18:47:00 +00:00
|
|
|
#include "mozilla/net/FTPChannelParent.h"
|
2011-05-04 13:36:23 +00:00
|
|
|
#include "mozilla/net/WebSocketChannelParent.h"
|
|
|
|
#include "mozilla/dom/TabParent.h"
|
2009-08-18 19:05:15 +00:00
|
|
|
|
2010-07-26 18:49:09 +00:00
|
|
|
#include "nsHTMLDNSPrefetch.h"
|
|
|
|
|
2011-05-04 13:36:23 +00:00
|
|
|
using mozilla::dom::TabParent;
|
|
|
|
|
2009-08-18 19:05:15 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
|
|
|
// C++ file contents
|
|
|
|
NeckoParent::NeckoParent()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
NeckoParent::~NeckoParent()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
PHttpChannelParent*
|
2010-08-11 03:11:57 +00:00
|
|
|
NeckoParent::AllocPHttpChannel(PBrowserParent* browser)
|
2009-08-18 19:05:15 +00:00
|
|
|
{
|
2010-08-11 03:11:57 +00:00
|
|
|
HttpChannelParent *p = new HttpChannelParent(browser);
|
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
|
|
|
p->AddRef();
|
|
|
|
return p;
|
2009-08-18 19:05:15 +00:00
|
|
|
}
|
|
|
|
|
2009-09-17 23:09:20 +00:00
|
|
|
bool
|
2009-09-22 17:31:11 +00:00
|
|
|
NeckoParent::DeallocPHttpChannel(PHttpChannelParent* channel)
|
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
|
|
|
HttpChannelParent *p = static_cast<HttpChannelParent *>(channel);
|
|
|
|
p->Release();
|
2009-09-17 23:09:20 +00:00
|
|
|
return true;
|
2009-08-18 19:05:15 +00:00
|
|
|
}
|
|
|
|
|
2010-08-10 18:47:00 +00:00
|
|
|
PFTPChannelParent*
|
|
|
|
NeckoParent::AllocPFTPChannel()
|
|
|
|
{
|
|
|
|
FTPChannelParent *p = new FTPChannelParent();
|
|
|
|
p->AddRef();
|
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
NeckoParent::DeallocPFTPChannel(PFTPChannelParent* channel)
|
|
|
|
{
|
|
|
|
FTPChannelParent *p = static_cast<FTPChannelParent *>(channel);
|
|
|
|
p->Release();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-03-25 23:02:28 +00:00
|
|
|
PCookieServiceParent*
|
|
|
|
NeckoParent::AllocPCookieService()
|
|
|
|
{
|
|
|
|
return new CookieServiceParent();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
NeckoParent::DeallocPCookieService(PCookieServiceParent* cs)
|
|
|
|
{
|
|
|
|
delete cs;
|
|
|
|
return true;
|
|
|
|
}
|
2009-08-18 19:05:15 +00:00
|
|
|
|
2010-10-11 11:35:10 +00:00
|
|
|
PWyciwygChannelParent*
|
|
|
|
NeckoParent::AllocPWyciwygChannel()
|
|
|
|
{
|
|
|
|
WyciwygChannelParent *p = new WyciwygChannelParent();
|
|
|
|
p->AddRef();
|
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
NeckoParent::DeallocPWyciwygChannel(PWyciwygChannelParent* channel)
|
|
|
|
{
|
|
|
|
WyciwygChannelParent *p = static_cast<WyciwygChannelParent *>(channel);
|
|
|
|
p->Release();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2011-05-04 13:36:23 +00:00
|
|
|
PWebSocketParent*
|
|
|
|
NeckoParent::AllocPWebSocket(PBrowserParent* browser)
|
|
|
|
{
|
|
|
|
TabParent* tabParent = static_cast<TabParent*>(browser);
|
|
|
|
WebSocketChannelParent* p = new WebSocketChannelParent(tabParent);
|
|
|
|
p->AddRef();
|
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
NeckoParent::DeallocPWebSocket(PWebSocketParent* actor)
|
|
|
|
{
|
|
|
|
WebSocketChannelParent* p = static_cast<WebSocketChannelParent*>(actor);
|
|
|
|
p->Release();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-07-26 18:49:09 +00:00
|
|
|
bool
|
|
|
|
NeckoParent::RecvHTMLDNSPrefetch(const nsString& hostname,
|
|
|
|
const PRUint16& flags)
|
|
|
|
{
|
2012-01-20 23:14:46 +00:00
|
|
|
nsHTMLDNSPrefetch::Prefetch(hostname, flags);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
NeckoParent::RecvCancelHTMLDNSPrefetch(const nsString& hostname,
|
|
|
|
const PRUint16& flags,
|
|
|
|
const nsresult& reason)
|
|
|
|
{
|
|
|
|
nsHTMLDNSPrefetch::CancelPrefetch(hostname, flags, reason);
|
2010-07-26 18:49:09 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2009-08-18 19:05:15 +00:00
|
|
|
}} // mozilla::net
|
|
|
|
|