Moving cookie ipc source to the right place.
authorDoug Turner <dougt@dougt.org>
Mon, 07 Jun 2010 14:19:20 -0700
changeset 46894 55fae139a210f8be3f3fcab9df71a7bab5ec2113
parent 46893 a9d29c4a712b2ec4827f77b3e6a8867cf6b97db6
child 46895 03c8158afebe4bc410deef00a17d7f29ca94b808
push id14210
push userdougt@mozilla.com
push dateThu, 01 Jul 2010 06:28:42 +0000
treeherdermozilla-central@3aff97777291 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Moving cookie ipc source to the right place.
ipc/ipdl/Makefile.in
netwerk/cookie/CookieServiceChild.cpp
netwerk/cookie/CookieServiceChild.h
netwerk/cookie/CookieServiceParent.cpp
netwerk/cookie/CookieServiceParent.h
netwerk/cookie/Makefile.in
netwerk/cookie/PCookieService.ipdl
netwerk/cookie/ipdl.mk
netwerk/cookie/src/CookieServiceChild.cpp
netwerk/cookie/src/CookieServiceChild.h
netwerk/cookie/src/CookieServiceParent.cpp
netwerk/cookie/src/CookieServiceParent.h
netwerk/cookie/src/PCookieService.ipdl
netwerk/cookie/src/ipdl.mk
--- a/ipc/ipdl/Makefile.in
+++ b/ipc/ipdl/Makefile.in
@@ -54,17 +54,17 @@ EXPORT_LIBRARY = 1
 ## When you add IPDL files to a source directory, list the directory here.
 ##
 IPDLDIRS =  \
   dom/src/geolocation \
   dom/plugins  \
   dom/ipc  \
   netwerk/ipc  \
   netwerk/protocol/http/src  \
-  netwerk/cookie/src  \
+  netwerk/cookie  \
   ipc/ipdl/test/cxx  \
   ipc/testshell  \
   js/ipc  \
   $(NULL)
 ##-----------------------------------------------------------------------------
 
 ifdef MOZ_IPDL_TESTS
 DIRS += test
new file mode 100644
--- /dev/null
+++ b/netwerk/cookie/CookieServiceChild.cpp
@@ -0,0 +1,180 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** 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 <http://www.mozilla.org/>.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Witte <dwitte@mozilla.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/CookieServiceChild.h"
+#include "mozilla/net/NeckoChild.h"
+#include "nsIURI.h"
+
+namespace mozilla {
+namespace net {
+
+static CookieServiceChild *gCookieService;
+
+CookieServiceChild*
+CookieServiceChild::GetSingleton()
+{
+  if (!gCookieService)
+    gCookieService = new CookieServiceChild();
+
+  NS_ADDREF(gCookieService);
+  return gCookieService;
+}
+
+NS_IMPL_ISUPPORTS1(CookieServiceChild, nsICookieService)
+
+CookieServiceChild::CookieServiceChild()
+{
+  NS_ASSERTION(IsNeckoChild(), "not a child process");
+
+  // This corresponds to Release() in DeallocPCookieService.
+  NS_ADDREF_THIS();
+
+  // Create a child PCookieService actor.
+  NeckoChild::InitNeckoChild();
+  gNeckoChild->SendPCookieServiceConstructor(this);
+
+  mPermissionService = do_GetService(NS_COOKIEPERMISSION_CONTRACTID);
+  if (!mPermissionService)
+    NS_WARNING("couldn't get nsICookiePermission in child");
+}
+
+CookieServiceChild::~CookieServiceChild()
+{
+  gCookieService = nsnull;
+}
+
+nsresult
+CookieServiceChild::GetCookieStringInternal(nsIURI *aHostURI,
+                                            nsIChannel *aChannel,
+                                            char **aCookieString,
+                                            bool aFromHttp)
+{
+  NS_ENSURE_ARG(aHostURI);
+  NS_ENSURE_ARG_POINTER(aCookieString);
+
+  *aCookieString = NULL;
+
+  // Determine the originating URI. Failure is acceptable.
+  nsCOMPtr<nsIURI> originatingURI;
+  if (!mPermissionService) {
+    NS_WARNING("nsICookiePermission unavailable! Cookie may be rejected");
+    mPermissionService->GetOriginatingURI(aChannel,
+                                          getter_AddRefs(originatingURI));
+  }
+
+  // Synchronously call the parent.
+  nsCAutoString result;
+  SendGetCookieString(IPC::URI(aHostURI), IPC::URI(originatingURI),
+                      aFromHttp, &result);
+  if (!result.IsEmpty())
+    *aCookieString = ToNewCString(result);
+
+  return NS_OK;
+}
+
+nsresult
+CookieServiceChild::SetCookieStringInternal(nsIURI *aHostURI,
+                                            nsIChannel *aChannel,
+                                            const char *aCookieString,
+                                            const char *aServerTime,
+                                            bool aFromHttp)
+{
+  NS_ENSURE_ARG(aHostURI);
+  NS_ENSURE_ARG_POINTER(aCookieString);
+
+  // Determine the originating URI. Failure is acceptable.
+  nsCOMPtr<nsIURI> originatingURI;
+  if (!mPermissionService) {
+    NS_WARNING("nsICookiePermission unavailable! Cookie may be rejected");
+    mPermissionService->GetOriginatingURI(aChannel,
+                                          getter_AddRefs(originatingURI));
+  }
+
+  nsDependentCString cookieString(aCookieString);
+  nsDependentCString serverTime;
+  if (aServerTime)
+    serverTime.Rebind(aServerTime);
+
+  // Synchronously call the parent.
+  SendSetCookieString(IPC::URI(aHostURI), IPC::URI(originatingURI),
+                      cookieString, serverTime, aFromHttp);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+CookieServiceChild::GetCookieString(nsIURI *aHostURI,
+                                    nsIChannel *aChannel,
+                                    char **aCookieString)
+{
+  return GetCookieStringInternal(aHostURI, aChannel, aCookieString, false);
+}
+
+NS_IMETHODIMP
+CookieServiceChild::GetCookieStringFromHttp(nsIURI *aHostURI,
+                                            nsIURI *aFirstURI,
+                                            nsIChannel *aChannel,
+                                            char **aCookieString)
+{
+  return GetCookieStringInternal(aHostURI, aChannel, aCookieString, true);
+}
+
+NS_IMETHODIMP
+CookieServiceChild::SetCookieString(nsIURI *aHostURI,
+                                    nsIPrompt *aPrompt,
+                                    const char *aCookieString,
+                                    nsIChannel *aChannel)
+{
+  return SetCookieStringInternal(aHostURI, aChannel, aCookieString,
+                                 nsnull, false);
+}
+
+NS_IMETHODIMP
+CookieServiceChild::SetCookieStringFromHttp(nsIURI     *aHostURI,
+                                            nsIURI     *aFirstURI,
+                                            nsIPrompt  *aPrompt,
+                                            const char *aCookieString,
+                                            const char *aServerTime,
+                                            nsIChannel *aChannel) 
+{
+  return SetCookieStringInternal(aHostURI, aChannel, aCookieString,
+                                 aServerTime, true);
+}
+
+}
+}
+
new file mode 100644
--- /dev/null
+++ b/netwerk/cookie/CookieServiceChild.h
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** 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 <http://www.mozilla.org/>.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Witte <dwitte@mozilla.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_CookieServiceChild_h__
+#define mozilla_net_CookieServiceChild_h__
+
+#include "mozilla/net/PCookieServiceChild.h"
+#include "nsICookieService.h"
+#include "nsICookiePermission.h"
+
+namespace mozilla {
+namespace net {
+
+class CookieServiceChild : public PCookieServiceChild
+                         , public nsICookieService
+{
+public:
+  NS_DECL_ISUPPORTS
+  NS_DECL_NSICOOKIESERVICE
+
+  CookieServiceChild();
+  virtual ~CookieServiceChild();
+
+  static CookieServiceChild* GetSingleton();
+
+protected:
+  void SerializeURIs(nsIURI *aHostURI,
+                     nsIChannel *aChannel,
+                     nsCString &aHostSpec,
+                     nsCString &aHostCharset,
+                     nsCString &aOriginatingSpec,
+                     nsCString &aOriginatingCharset);
+
+  nsresult GetCookieStringInternal(nsIURI *aHostURI,
+                                   nsIChannel *aChannel,
+                                   char **aCookieString,
+                                   bool aFromHttp);
+
+  nsresult SetCookieStringInternal(nsIURI *aHostURI,
+                                   nsIChannel *aChannel,
+                                   const char *aCookieString,
+                                   const char *aServerTime,
+                                   bool aFromHttp);
+
+  nsCOMPtr<nsICookiePermission> mPermissionService;
+};
+
+}
+}
+
+#endif // mozilla_net_CookieServiceChild_h__
+
new file mode 100644
--- /dev/null
+++ b/netwerk/cookie/CookieServiceParent.cpp
@@ -0,0 +1,108 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** 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 <http://www.mozilla.org/>.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Witte <dwitte@mozilla.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/CookieServiceParent.h"
+#include "nsCookieService.h"
+#include "nsNetUtil.h"
+
+namespace mozilla {
+namespace net {
+
+CookieServiceParent::CookieServiceParent()
+{
+  // Instantiate the cookieservice via the service manager, so it sticks around
+  // until shutdown.
+  nsCOMPtr<nsICookieService> cs = do_GetService(NS_COOKIESERVICE_CONTRACTID);
+
+  // Get the nsCookieService instance directly, so we can call internal methods.
+  mCookieService =
+    already_AddRefed<nsCookieService>(nsCookieService::GetSingleton());
+  NS_ASSERTION(mCookieService, "couldn't get nsICookieService");
+}
+
+CookieServiceParent::~CookieServiceParent()
+{
+}
+
+bool
+CookieServiceParent::RecvGetCookieString(const IPC::URI& aHost,
+                                         const IPC::URI& aOriginating,
+                                         const bool& aFromHttp,
+                                         nsCString* aResult)
+{
+  if (!mCookieService)
+    return true;
+
+  // Deserialize URIs. Having a host URI is mandatory and should always be
+  // provided by the child; thus we consider failure fatal.
+  nsCOMPtr<nsIURI> hostURI = aHost;
+  nsCOMPtr<nsIURI> originatingURI = aOriginating;
+  if (!hostURI)
+    return false;
+
+  mCookieService->GetCookieInternal(hostURI, originatingURI,
+                                    aFromHttp, *aResult);
+  return true;
+}
+
+bool
+CookieServiceParent::RecvSetCookieString(const IPC::URI& aHost,
+                                         const IPC::URI& aOriginating,
+                                         const nsCString& aCookieString,
+                                         const nsCString& aServerTime,
+                                         const bool& aFromHttp)
+{
+  if (!mCookieService)
+    return true;
+
+  // Deserialize URIs. Having a host URI is mandatory and should always be
+  // provided by the child; thus we consider failure fatal.
+  nsCOMPtr<nsIURI> hostURI = aHost;
+  nsCOMPtr<nsIURI> originatingURI = aOriginating;
+  if (!hostURI)
+    return false;
+
+  mCookieService->SetCookieStringInternal(hostURI, originatingURI,
+                                          aCookieString, aServerTime,
+                                          aFromHttp);
+  return true;
+}
+
+}
+}
+
new file mode 100644
--- /dev/null
+++ b/netwerk/cookie/CookieServiceParent.h
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** 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 <http://www.mozilla.org/>.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Witte <dwitte@mozilla.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_CookieServiceParent_h
+#define mozilla_net_CookieServiceParent_h
+
+#include "mozilla/net/PCookieServiceParent.h"
+
+class nsCookieService;
+class nsIIOService;
+
+namespace mozilla {
+namespace net {
+
+class CookieServiceParent : public PCookieServiceParent
+{
+public:
+  CookieServiceParent();
+  virtual ~CookieServiceParent();
+
+protected:
+  virtual bool RecvGetCookieString(const IPC::URI& aHost,
+                                   const IPC::URI& aOriginating,
+                                   const bool& aFromHttp,
+                                   nsCString* aResult);
+
+  virtual bool RecvSetCookieString(const IPC::URI& aHost,
+                                   const IPC::URI& aOriginating,
+                                   const nsCString& aCookieString,
+                                   const nsCString& aServerTime,
+                                   const bool& aFromHttp);
+
+  nsRefPtr<nsCookieService> mCookieService;
+};
+
+}
+}
+
+#endif // mozilla_net_CookieServiceParent_h
+
--- a/netwerk/cookie/Makefile.in
+++ b/netwerk/cookie/Makefile.in
@@ -63,13 +63,31 @@ XPIDLSRCS = \
 ifdef NECKO_COOKIES
 LIBRARY_NAME     = neckocookie_s
 LIBXUL_LIBRARY   = 1
 FORCE_STATIC_LIB = 1
 CPPSRCS = \
   nsCookie.cpp \
   nsCookieService.cpp \
   $(NULL)
+
+
+ifdef MOZ_IPC
+EXPORTS_NAMESPACES = mozilla/net
+
+EXPORTS_mozilla/net = \
+		CookieServiceParent.h \
+		CookieServiceChild.h  \
+		$(NULL)
+
+CPPSRCS += \
+		CookieServiceParent.cpp \
+		CookieServiceChild.cpp \
+		$(NULL)
+endif
 endif
 
+
+include $(topsrcdir)/config/config.mk
+include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += -DIMPL_NS_NET
new file mode 100644
--- /dev/null
+++ b/netwerk/cookie/PCookieService.ipdl
@@ -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 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) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Daniel Witte <dwitte@mozilla.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;
+
+include "mozilla/net/NeckoMessageUtils.h";
+
+using IPC::URI;
+
+namespace mozilla {
+namespace net {
+
+sync protocol PCookieService
+{
+  manager PNecko;
+
+parent:
+  sync GetCookieString(URI host,
+                       URI originating,
+                       bool fromHttp)
+       returns (nsCString result);
+
+  SetCookieString(URI host,
+                  URI originating,
+                  nsCString cookieString,
+                  nsCString serverTime,
+                  bool fromHttp);
+
+  __delete__();
+};
+
+}
+}
+
new file mode 100644
--- /dev/null
+++ b/netwerk/cookie/ipdl.mk
@@ -0,0 +1,41 @@
+# ***** 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) 2010
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Daniel Witte <dwitte@mozilla.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 *****
+
+IPDLSRCS =            \
+  PCookieService.ipdl \
+  $(NULL)
+
deleted file mode 100644
--- a/netwerk/cookie/src/CookieServiceChild.cpp
+++ /dev/null
@@ -1,180 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** 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 <http://www.mozilla.org/>.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Daniel Witte <dwitte@mozilla.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/CookieServiceChild.h"
-#include "mozilla/net/NeckoChild.h"
-#include "nsIURI.h"
-
-namespace mozilla {
-namespace net {
-
-static CookieServiceChild *gCookieService;
-
-CookieServiceChild*
-CookieServiceChild::GetSingleton()
-{
-  if (!gCookieService)
-    gCookieService = new CookieServiceChild();
-
-  NS_ADDREF(gCookieService);
-  return gCookieService;
-}
-
-NS_IMPL_ISUPPORTS1(CookieServiceChild, nsICookieService)
-
-CookieServiceChild::CookieServiceChild()
-{
-  NS_ASSERTION(IsNeckoChild(), "not a child process");
-
-  // This corresponds to Release() in DeallocPCookieService.
-  NS_ADDREF_THIS();
-
-  // Create a child PCookieService actor.
-  NeckoChild::InitNeckoChild();
-  gNeckoChild->SendPCookieServiceConstructor(this);
-
-  mPermissionService = do_GetService(NS_COOKIEPERMISSION_CONTRACTID);
-  if (!mPermissionService)
-    NS_WARNING("couldn't get nsICookiePermission in child");
-}
-
-CookieServiceChild::~CookieServiceChild()
-{
-  gCookieService = nsnull;
-}
-
-nsresult
-CookieServiceChild::GetCookieStringInternal(nsIURI *aHostURI,
-                                            nsIChannel *aChannel,
-                                            char **aCookieString,
-                                            bool aFromHttp)
-{
-  NS_ENSURE_ARG(aHostURI);
-  NS_ENSURE_ARG_POINTER(aCookieString);
-
-  *aCookieString = NULL;
-
-  // Determine the originating URI. Failure is acceptable.
-  nsCOMPtr<nsIURI> originatingURI;
-  if (!mPermissionService) {
-    NS_WARNING("nsICookiePermission unavailable! Cookie may be rejected");
-    mPermissionService->GetOriginatingURI(aChannel,
-                                          getter_AddRefs(originatingURI));
-  }
-
-  // Synchronously call the parent.
-  nsCAutoString result;
-  SendGetCookieString(IPC::URI(aHostURI), IPC::URI(originatingURI),
-                      aFromHttp, &result);
-  if (!result.IsEmpty())
-    *aCookieString = ToNewCString(result);
-
-  return NS_OK;
-}
-
-nsresult
-CookieServiceChild::SetCookieStringInternal(nsIURI *aHostURI,
-                                            nsIChannel *aChannel,
-                                            const char *aCookieString,
-                                            const char *aServerTime,
-                                            bool aFromHttp)
-{
-  NS_ENSURE_ARG(aHostURI);
-  NS_ENSURE_ARG_POINTER(aCookieString);
-
-  // Determine the originating URI. Failure is acceptable.
-  nsCOMPtr<nsIURI> originatingURI;
-  if (!mPermissionService) {
-    NS_WARNING("nsICookiePermission unavailable! Cookie may be rejected");
-    mPermissionService->GetOriginatingURI(aChannel,
-                                          getter_AddRefs(originatingURI));
-  }
-
-  nsDependentCString cookieString(aCookieString);
-  nsDependentCString serverTime;
-  if (aServerTime)
-    serverTime.Rebind(aServerTime);
-
-  // Synchronously call the parent.
-  SendSetCookieString(IPC::URI(aHostURI), IPC::URI(originatingURI),
-                      cookieString, serverTime, aFromHttp);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-CookieServiceChild::GetCookieString(nsIURI *aHostURI,
-                                    nsIChannel *aChannel,
-                                    char **aCookieString)
-{
-  return GetCookieStringInternal(aHostURI, aChannel, aCookieString, false);
-}
-
-NS_IMETHODIMP
-CookieServiceChild::GetCookieStringFromHttp(nsIURI *aHostURI,
-                                            nsIURI *aFirstURI,
-                                            nsIChannel *aChannel,
-                                            char **aCookieString)
-{
-  return GetCookieStringInternal(aHostURI, aChannel, aCookieString, true);
-}
-
-NS_IMETHODIMP
-CookieServiceChild::SetCookieString(nsIURI *aHostURI,
-                                    nsIPrompt *aPrompt,
-                                    const char *aCookieString,
-                                    nsIChannel *aChannel)
-{
-  return SetCookieStringInternal(aHostURI, aChannel, aCookieString,
-                                 nsnull, false);
-}
-
-NS_IMETHODIMP
-CookieServiceChild::SetCookieStringFromHttp(nsIURI     *aHostURI,
-                                            nsIURI     *aFirstURI,
-                                            nsIPrompt  *aPrompt,
-                                            const char *aCookieString,
-                                            const char *aServerTime,
-                                            nsIChannel *aChannel) 
-{
-  return SetCookieStringInternal(aHostURI, aChannel, aCookieString,
-                                 aServerTime, true);
-}
-
-}
-}
-
deleted file mode 100644
--- a/netwerk/cookie/src/CookieServiceChild.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** 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 <http://www.mozilla.org/>.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Daniel Witte <dwitte@mozilla.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_CookieServiceChild_h__
-#define mozilla_net_CookieServiceChild_h__
-
-#include "mozilla/net/PCookieServiceChild.h"
-#include "nsICookieService.h"
-#include "nsICookiePermission.h"
-
-namespace mozilla {
-namespace net {
-
-class CookieServiceChild : public PCookieServiceChild
-                         , public nsICookieService
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSICOOKIESERVICE
-
-  CookieServiceChild();
-  virtual ~CookieServiceChild();
-
-  static CookieServiceChild* GetSingleton();
-
-protected:
-  void SerializeURIs(nsIURI *aHostURI,
-                     nsIChannel *aChannel,
-                     nsCString &aHostSpec,
-                     nsCString &aHostCharset,
-                     nsCString &aOriginatingSpec,
-                     nsCString &aOriginatingCharset);
-
-  nsresult GetCookieStringInternal(nsIURI *aHostURI,
-                                   nsIChannel *aChannel,
-                                   char **aCookieString,
-                                   bool aFromHttp);
-
-  nsresult SetCookieStringInternal(nsIURI *aHostURI,
-                                   nsIChannel *aChannel,
-                                   const char *aCookieString,
-                                   const char *aServerTime,
-                                   bool aFromHttp);
-
-  nsCOMPtr<nsICookiePermission> mPermissionService;
-};
-
-}
-}
-
-#endif // mozilla_net_CookieServiceChild_h__
-
deleted file mode 100644
--- a/netwerk/cookie/src/CookieServiceParent.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** 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 <http://www.mozilla.org/>.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Daniel Witte <dwitte@mozilla.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/CookieServiceParent.h"
-#include "nsCookieService.h"
-#include "nsNetUtil.h"
-
-namespace mozilla {
-namespace net {
-
-CookieServiceParent::CookieServiceParent()
-{
-  // Instantiate the cookieservice via the service manager, so it sticks around
-  // until shutdown.
-  nsCOMPtr<nsICookieService> cs = do_GetService(NS_COOKIESERVICE_CONTRACTID);
-
-  // Get the nsCookieService instance directly, so we can call internal methods.
-  mCookieService =
-    already_AddRefed<nsCookieService>(nsCookieService::GetSingleton());
-  NS_ASSERTION(mCookieService, "couldn't get nsICookieService");
-}
-
-CookieServiceParent::~CookieServiceParent()
-{
-}
-
-bool
-CookieServiceParent::RecvGetCookieString(const IPC::URI& aHost,
-                                         const IPC::URI& aOriginating,
-                                         const bool& aFromHttp,
-                                         nsCString* aResult)
-{
-  if (!mCookieService)
-    return true;
-
-  // Deserialize URIs. Having a host URI is mandatory and should always be
-  // provided by the child; thus we consider failure fatal.
-  nsCOMPtr<nsIURI> hostURI = aHost;
-  nsCOMPtr<nsIURI> originatingURI = aOriginating;
-  if (!hostURI)
-    return false;
-
-  mCookieService->GetCookieInternal(hostURI, originatingURI,
-                                    aFromHttp, *aResult);
-  return true;
-}
-
-bool
-CookieServiceParent::RecvSetCookieString(const IPC::URI& aHost,
-                                         const IPC::URI& aOriginating,
-                                         const nsCString& aCookieString,
-                                         const nsCString& aServerTime,
-                                         const bool& aFromHttp)
-{
-  if (!mCookieService)
-    return true;
-
-  // Deserialize URIs. Having a host URI is mandatory and should always be
-  // provided by the child; thus we consider failure fatal.
-  nsCOMPtr<nsIURI> hostURI = aHost;
-  nsCOMPtr<nsIURI> originatingURI = aOriginating;
-  if (!hostURI)
-    return false;
-
-  mCookieService->SetCookieStringInternal(hostURI, originatingURI,
-                                          aCookieString, aServerTime,
-                                          aFromHttp);
-  return true;
-}
-
-}
-}
-
deleted file mode 100644
--- a/netwerk/cookie/src/CookieServiceParent.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** 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 <http://www.mozilla.org/>.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Daniel Witte <dwitte@mozilla.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_CookieServiceParent_h
-#define mozilla_net_CookieServiceParent_h
-
-#include "mozilla/net/PCookieServiceParent.h"
-
-class nsCookieService;
-class nsIIOService;
-
-namespace mozilla {
-namespace net {
-
-class CookieServiceParent : public PCookieServiceParent
-{
-public:
-  CookieServiceParent();
-  virtual ~CookieServiceParent();
-
-protected:
-  virtual bool RecvGetCookieString(const IPC::URI& aHost,
-                                   const IPC::URI& aOriginating,
-                                   const bool& aFromHttp,
-                                   nsCString* aResult);
-
-  virtual bool RecvSetCookieString(const IPC::URI& aHost,
-                                   const IPC::URI& aOriginating,
-                                   const nsCString& aCookieString,
-                                   const nsCString& aServerTime,
-                                   const bool& aFromHttp);
-
-  nsRefPtr<nsCookieService> mCookieService;
-};
-
-}
-}
-
-#endif // mozilla_net_CookieServiceParent_h
-
deleted file mode 100644
--- a/netwerk/cookie/src/PCookieService.ipdl
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- 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) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Daniel Witte <dwitte@mozilla.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;
-
-include "mozilla/net/NeckoMessageUtils.h";
-
-using IPC::URI;
-
-namespace mozilla {
-namespace net {
-
-sync protocol PCookieService
-{
-  manager PNecko;
-
-parent:
-  sync GetCookieString(URI host,
-                       URI originating,
-                       bool fromHttp)
-       returns (nsCString result);
-
-  SetCookieString(URI host,
-                  URI originating,
-                  nsCString cookieString,
-                  nsCString serverTime,
-                  bool fromHttp);
-
-  __delete__();
-};
-
-}
-}
-
deleted file mode 100644
--- a/netwerk/cookie/src/ipdl.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# ***** 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) 2010
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Daniel Witte <dwitte@mozilla.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 *****
-
-IPDLSRCS =            \
-  PCookieService.ipdl \
-  $(NULL)
-