Necko init patch, with modeline fixes

This commit is contained in:
Jason Duell 2009-08-18 12:05:15 -07:00
Родитель 6eba2e3fe8
Коммит 9a3a9ea726
33 изменённых файлов: 926 добавлений и 19 удалений

Просмотреть файл

@ -1,5 +1,5 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: sw=4 ts=4 et : */
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -40,6 +40,7 @@
#include "TabChild.h"
#include "mozilla/ipc/TestShellChild.h"
#include "mozilla/net/NeckoChild.h"
#include "nsXULAppAPI.h"
@ -47,6 +48,7 @@
#include "base/task.h"
using namespace mozilla::ipc;
using namespace mozilla::net;
namespace mozilla {
namespace dom {
@ -109,6 +111,19 @@ ContentProcessChild::PTestShellDestructor(PTestShellChild* shell)
return NS_OK;
}
PNeckoChild*
ContentProcessChild::PNeckoConstructor()
{
return new NeckoChild();
}
nsresult
ContentProcessChild::PNeckoDestructor(PNeckoChild* necko)
{
delete necko;
return NS_OK;
}
void
ContentProcessChild::Quit()
{

Просмотреть файл

@ -1,5 +1,5 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: sw=4 ts=4 et : */
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -60,12 +60,16 @@ public:
return sSingleton;
}
virtual PIFrameEmbeddingChild* PIFrameEmbeddingConstructor(const MagicWindowHandle& hwnd);
virtual PIFrameEmbeddingChild* PIFrameEmbeddingConstructor(
const MagicWindowHandle& hwnd);
virtual nsresult PIFrameEmbeddingDestructor(PIFrameEmbeddingChild*);
virtual PTestShellChild* PTestShellConstructor();
virtual nsresult PTestShellDestructor(PTestShellChild*);
virtual PNeckoChild* PNeckoConstructor();
virtual nsresult PNeckoDestructor(PNeckoChild*);
void Quit();
virtual nsresult RecvQuit();

Просмотреть файл

@ -1,5 +1,5 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: sw=4 ts=4 et : */
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -42,6 +42,7 @@
#include "TabParent.h"
#include "mozilla/ipc/TestShellParent.h"
#include "mozilla/net/NeckoParent.h"
#include "nsIObserverService.h"
@ -51,6 +52,7 @@
#include "nsThreadUtils.h"
using namespace mozilla::ipc;
using namespace mozilla::net;
using mozilla::MonitorAutoEnter;
namespace {
@ -141,7 +143,8 @@ ContentProcessParent::OnWaitableEventSignaled(base::WaitableEvent *event)
}
PIFrameEmbeddingParent*
ContentProcessParent::PIFrameEmbeddingConstructor(const MagicWindowHandle& parentWidget)
ContentProcessParent::PIFrameEmbeddingConstructor(
const MagicWindowHandle& parentWidget)
{
return new TabParent();
}
@ -166,5 +169,18 @@ ContentProcessParent::PTestShellDestructor(PTestShellParent* shell)
return NS_OK;
}
PNeckoParent*
ContentProcessParent::PNeckoConstructor()
{
return new NeckoParent();
}
nsresult
ContentProcessParent::PNeckoDestructor(PNeckoParent* necko)
{
delete necko;
return NS_OK;
}
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -1,5 +1,5 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: sw=4 ts=4 et : */
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -91,12 +91,16 @@ private:
ContentProcessParent();
virtual ~ContentProcessParent();
virtual PIFrameEmbeddingParent* PIFrameEmbeddingConstructor(const MagicWindowHandle& parentWidget);
virtual PIFrameEmbeddingParent* PIFrameEmbeddingConstructor(
const MagicWindowHandle& parentWidget);
virtual nsresult PIFrameEmbeddingDestructor(PIFrameEmbeddingParent* frame);
virtual PTestShellParent* PTestShellConstructor();
virtual nsresult PTestShellDestructor(PTestShellParent* shell);
virtual PNeckoParent* PNeckoConstructor();
virtual nsresult PNeckoDestructor(PNeckoParent* necko);
mozilla::Monitor mMonitor;
GeckoChildProcessHost* mSubprocess;

Просмотреть файл

@ -1,5 +1,5 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: sw=4 ts=4 et :
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set sw=4 ts=8 et tw=80 :
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*

Просмотреть файл

@ -1,5 +1,5 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: sw=4 ts=4 et :
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set sw=4 ts=8 et tw=80 :
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*

Просмотреть файл

@ -1,4 +1,5 @@
/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -37,6 +38,7 @@
include protocol "PIFrameEmbedding.ipdl";
include protocol "PTestShell.ipdl";
include protocol "PNecko.ipdl";
include "mozilla/TabTypes.h";
@ -49,6 +51,7 @@ sync protocol PContentProcess
{
manages PIFrameEmbedding;
manages PTestShell;
manages PNecko;
child:
PIFrameEmbedding(MagicWindowHandle parentWidget);
@ -58,6 +61,10 @@ child:
~PTestShell();
Quit();
parent:
PNecko();
~PNecko();
};
}

Просмотреть файл

@ -1,4 +1,6 @@
/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*

Просмотреть файл

@ -1,4 +1,5 @@
/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*

Просмотреть файл

@ -1,4 +1,5 @@
/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*

Просмотреть файл

@ -1,5 +1,5 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: sw=4 ts=4 et : */
/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*

Просмотреть файл

@ -1,5 +1,5 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: sw=4 ts=4 et : */
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*

Просмотреть файл

@ -1,3 +1,6 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
#ifndef mozilla_tabs_TabTypes_h
#define mozilla_tabs_TabTypes_h

Просмотреть файл

@ -45,6 +45,8 @@ include $(topsrcdir)/config/rules.mk
IPDLDIRS = \
dom/plugins \
dom/ipc \
netwerk/ipc \
netwerk/protocol/http/src \
ipc/test-harness \
ipc/testshell \
$(NULL)

Просмотреть файл

@ -56,6 +56,12 @@ DIRS = \
system \
$(NULL)
ifdef MOZ_IPC
DIRS += \
ipc \
$(NULL)
endif
ifdef NECKO_WIFI
DIRS += wifi
endif

Просмотреть файл

@ -63,6 +63,7 @@ SHARED_LIBRARY_LIBS = \
../mime/src/$(LIB_PREFIX)nkmime_s.$(LIB_SUFFIX) \
../cache/src/$(LIB_PREFIX)nkcache_s.$(LIB_SUFFIX) \
../protocol/about/src/$(LIB_PREFIX)nkabout_s.$(LIB_SUFFIX) \
../ipc/$(LIB_PREFIX)neckoipc_s.$(LIB_SUFFIX) \
$(foreach d,$(filter-out about,$(NECKO_PROTOCOLS)), \
../protocol/$(d)/src/$(LIB_PREFIX)nk$(d)_s.$(LIB_SUFFIX)) \
$(NULL)
@ -146,6 +147,8 @@ ifeq ($(OS_ARCH),AIX)
EXTRA_DSO_LDOPTS += -lodm -lcfg
endif
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
include $(topsrcdir)/config/rules.mk
ifeq ($(OS_ARCH),WINNT)

Просмотреть файл

@ -92,6 +92,7 @@ typedef struct idn_nameprep *idn_nameprep_t;
*/
#define IDN_NAMEPREP_CURRENT "nameprep-11"
#undef assert
#define assert(a)
#define TRACE(a)

65
netwerk/ipc/Makefile.in Normal file
Просмотреть файл

@ -0,0 +1,65 @@
# ***** 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 Firefox.
#
# The Initial Developer of the Original Code is
# The Mozilla Foundation <http://www.mozilla.org/>.
# Portions created by the Initial Developer are Copyright (C) 2009
# the Initial Developer. All Rights Reserved.
#
# Contributor(s): Jason Duell
#
# 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 *****
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = necko
LIBRARY_NAME = neckoipc_s
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
EXPORT_LIBRARY = 1
EXPORTS_NAMESPACES = mozilla/net
EXPORTS_mozilla/net = \
NeckoParent.h \
NeckoChild.h \
$(NULL)
CPPSRCS = \
NeckoChild.cpp \
NeckoParent.cpp \
$(NULL)
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -0,0 +1,84 @@
/* -*- 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>
*
* 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 ***** */
#include "mozilla/net/NeckoChild.h"
#include "mozilla/dom/ContentProcessChild.h"
#include "mozilla/net/HttpChannelChild.h"
namespace mozilla {
namespace net {
PNeckoChild *gNeckoChild = nsnull;
// C++ file contents
NeckoChild::NeckoChild()
{
}
NeckoChild::~NeckoChild()
{
}
void NeckoChild::InitNeckoChild()
{
if (XRE_GetProcessType() == GeckoProcessType_Content) {
mozilla::dom::ContentProcessChild * cpc =
mozilla::dom::ContentProcessChild::GetSingleton();
NS_ASSERTION(cpc, "Content Protocol is NULL!");
gNeckoChild = cpc->SendPNeckoConstructor();
NS_ASSERTION(gNeckoChild, "PNecko Protocol init failed!");
}
}
PHttpChannelChild*
NeckoChild::PHttpChannelConstructor()
{
return new HttpChannelChild();
}
nsresult
NeckoChild::PHttpChannelDestructor(PHttpChannelChild* channel)
{
delete channel;
return NS_OK;
}
}} // mozilla::net

82
netwerk/ipc/NeckoChild.h Normal file
Просмотреть файл

@ -0,0 +1,82 @@
/* -*- 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>
*
* 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 ***** */
#ifndef mozilla_net_NeckoChild_h
#define mozilla_net_NeckoChild_h
#include "mozilla/net/PNeckoChild.h"
#include "mozilla/net/HttpChannelChild.h"
#include "nsXULAppAPI.h"
namespace mozilla {
namespace net {
// Header file contents
class NeckoChild :
public PNeckoChild
{
public:
NeckoChild();
virtual ~NeckoChild();
static void InitNeckoChild();
virtual PHttpChannelChild* PHttpChannelConstructor();
virtual nsresult PHttpChannelDestructor(PHttpChannelChild*);
protected:
};
/**
* Reference to the PNecko Child protocol.
* Null if this is not a content process.
*/
extern PNeckoChild *gNeckoChild;
static inline PRBool
IsNeckoChild()
{
return XRE_GetProcessType() == GeckoProcessType_Content;
}
} // namespace net
} // namespace mozilla
#endif // mozilla_net_NeckoChild_h

Просмотреть файл

@ -0,0 +1,71 @@
/* -*- 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>
*
* 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 ***** */
#include "mozilla/net/NeckoParent.h"
#include "mozilla/net/HttpChannelParent.h"
namespace mozilla {
namespace net {
// C++ file contents
NeckoParent::NeckoParent()
{
}
NeckoParent::~NeckoParent()
{
}
PHttpChannelParent*
NeckoParent::PHttpChannelConstructor()
{
return new HttpChannelParent();
}
nsresult
NeckoParent::PHttpChannelDestructor(PHttpChannelParent* channel)
{
delete channel;
return NS_OK;
}
}} // mozilla::net

66
netwerk/ipc/NeckoParent.h Normal file
Просмотреть файл

@ -0,0 +1,66 @@
/* -*- 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>
*
* 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 ***** */
#include "mozilla/net/PNeckoParent.h"
#include "mozilla/net/HttpChannelChild.h"
#ifndef mozilla_net_NeckoParent_h
#define mozilla_net_NeckoParent_h
namespace mozilla {
namespace net {
// Header file contents
class NeckoParent :
public PNeckoParent
{
public:
NeckoParent();
virtual ~NeckoParent();
protected:
virtual PHttpChannelParent* PHttpChannelConstructor();
virtual nsresult PHttpChannelDestructor(PHttpChannelParent*);
};
} // namespace net
} // namespace mozilla
#endif // mozilla_net_NeckoParent_h

61
netwerk/ipc/PNecko.ipdl Normal file
Просмотреть файл

@ -0,0 +1,61 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
/* ***** 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>
*
* 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 ***** */
include protocol "PContentProcess.ipdl";
include protocol "PHttpChannel.ipdl";
namespace mozilla {
namespace net {
//-------------------------------------------------------------------
protocol PNecko
{
manager PContentProcess;
manages PHttpChannel;
parent:
PHttpChannel();
~PHttpChannel();
};
} // namespace net
} // namespace mozilla

40
netwerk/ipc/ipdl.mk Normal file
Просмотреть файл

@ -0,0 +1,40 @@
# ***** 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 Firefox.
#
# The Initial Developer of the Original Code is
# The Mozilla Foundation <http://www.mozilla.org/>.
# Portions created by the Initial Developer are Copyright (C) 2009
# the Initial Developer. All Rights Reserved.
#
# Contributor(s): Jason Duell
#
# 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 *****
IPDLSRCS = \
PNecko.ipdl \
$(NULL)

Просмотреть файл

@ -0,0 +1,57 @@
/* -*- 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>
*
* 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 ***** */
#include "mozilla/net/HttpChannelChild.h"
#include "mozilla/dom/ContentProcessChild.h"
namespace mozilla {
namespace net {
// C++ file contents
HttpChannelChild::HttpChannelChild()
{
}
HttpChannelChild::~HttpChannelChild()
{
}
}} // mozilla::net

Просмотреть файл

@ -0,0 +1,65 @@
/* -*- 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>
*
* 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 ***** */
#ifndef mozilla_net_HttpChannelChild_h
#define mozilla_net_HttpChannelChild_h
#include "mozilla/net/PHttpChannelChild.h"
#include "nsXULAppAPI.h"
namespace mozilla {
namespace net {
// Header file contents
class HttpChannelChild :
public PHttpChannelChild
{
public:
HttpChannelChild();
virtual ~HttpChannelChild();
protected:
};
} // namespace net
} // namespace mozilla
#endif // mozilla_net_HttpChannelChild_h

Просмотреть файл

@ -0,0 +1,63 @@
/* -*- 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>
*
* 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 ***** */
#include "mozilla/net/HttpChannelParent.h"
namespace mozilla {
namespace net {
// C++ file contents
HttpChannelParent::HttpChannelParent()
{
}
HttpChannelParent::~HttpChannelParent()
{
}
//-----------------------------------------------------------------------------
//
nsresult HttpChannelParent::RecvasyncOpen(const nsCString& uri)
{
puts("[HttpChannelParent] got asyncOpen msg");
}
}} // mozilla::net

Просмотреть файл

@ -0,0 +1,64 @@
/* -*- 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>
*
* 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 ***** */
#ifndef mozilla_net_HttpChannelParent_h
#define mozilla_net_HttpChannelParent_h
#include "mozilla/net/PHttpChannelParent.h"
namespace mozilla {
namespace net {
// Header file contents
class HttpChannelParent :
public PHttpChannelParent
{
public:
HttpChannelParent();
virtual ~HttpChannelParent();
protected:
virtual nsresult RecvasyncOpen(const nsCString& uri);
};
} // namespace net
} // namespace mozilla
#endif // mozilla_net_HttpChannelParent_h

Просмотреть файл

@ -46,6 +46,12 @@ MODULE = necko
LIBRARY_NAME = nkhttp_s
LIBXUL_LIBRARY = 1
EXPORTS_NAMESPACES = mozilla/net
EXPORTS_mozilla/net = \
HttpChannelParent.h \
HttpChannelChild.h \
$(NULL)
CPPSRCS = \
nsHttp.cpp \
@ -65,6 +71,8 @@ CPPSRCS = \
nsHttpHandler.cpp \
nsHttpChannel.cpp \
nsHttpPipeline.cpp \
HttpChannelParent.cpp \
HttpChannelChild.cpp \
$(NULL)
LOCAL_INCLUDES=-I$(srcdir)/../../../base/src -I$(topsrcdir)/xpcom/ds
@ -73,6 +81,8 @@ LOCAL_INCLUDES=-I$(srcdir)/../../../base/src -I$(topsrcdir)/xpcom/ds
# static lib.
FORCE_STATIC_LIB = 1
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/ipc/chromium/chromium-config.mk
include $(topsrcdir)/config/rules.mk
DEFINES += -DIMPL_NS_NET

Просмотреть файл

@ -0,0 +1,59 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
/* ***** 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>
*
* 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 ***** */
include protocol "PNecko.ipdl";
namespace mozilla {
namespace net {
//-------------------------------------------------------------------
protocol PHttpChannel
{
manager PNecko;
parent:
asyncOpen(nsCString uri);
};
} // namespace net
} // namespace mozilla

Просмотреть файл

@ -0,0 +1,40 @@
# ***** 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 Firefox.
#
# The Initial Developer of the Original Code is
# The Mozilla Foundation <http://www.mozilla.org/>.
# Portions created by the Initial Developer are Copyright (C) 2009
# the Initial Developer. All Rights Reserved.
#
# Contributor(s): Jason Duell
#
# 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 *****
IPDLSRCS = \
PHttpChannel.ipdl \
$(NULL)

Просмотреть файл

@ -52,6 +52,10 @@
#include "nsURLHelper.h"
#include "netCore.h"
#ifdef MOZ_IPC
#include "mozilla/net/NeckoChild.h"
#endif
#if defined(PR_LOGGING)
//
// Log module for HTTP Protocol logging...
@ -67,6 +71,7 @@
extern PRLogModuleInfo *gHttpLog;
#endif
#undef LOG
// http logging
#define LOG1(args) PR_LOG(gHttpLog, 1, args)
#define LOG2(args) PR_LOG(gHttpLog, 2, args)

Просмотреть файл

@ -94,6 +94,11 @@
#include <os2.h>
#endif
//-----------------------------------------------------------------------------
#ifdef MOZ_IPC
using namespace mozilla::net;
#endif
#ifdef DEBUG
// defined by the socket transport service while active
extern PRThread *gSocketThread;
@ -223,6 +228,11 @@ nsHttpHandler::Init()
return rv;
}
#ifdef MOZ_IPC
if (IsNeckoChild() && !gNeckoChild)
NeckoChild::InitNeckoChild();
#endif // MOZ_IPC
InitUserAgentComponents();
// monitor some preference changes