Ejemplo n.º 1
0
PHttpChannelParent*
NeckoParent::AllocPHttpChannel(PBrowserParent* browser,
                               const SerializedLoadContext& loadContext)
{
  HttpChannelParent *p = new HttpChannelParent(browser, loadContext);
  p->AddRef();
  return p;
}
PHttpChannelParent*
NeckoParent::AllocPHttpChannelParent(PBrowserParent* aBrowser,
                                     const SerializedLoadContext& aSerialized,
                                     const HttpChannelCreationArgs& aOpenArgs)
{
  nsCOMPtr<nsILoadContext> loadContext;
  const char *error = CreateChannelLoadContext(aBrowser, Manager(),
                                               aSerialized, loadContext);
  if (error) {
    printf_stderr("NeckoParent::AllocPHttpChannelParent: "
                  "FATAL error: %s: KILLING CHILD PROCESS\n",
                  error);
    return nullptr;
  }
  PBOverrideStatus overrideStatus = PBOverrideStatusFromLoadContext(aSerialized);
  HttpChannelParent *p = new HttpChannelParent(aBrowser, loadContext, overrideStatus);
  p->AddRef();
  return p;
}