gecko-dev/dom/fetch/InternalRequest.cpp
Nikhil Marathe 7fd4527a9a Bug 1119044 - Fetch API WebIDL Fixes. r=bkelly,baku
Add various [SameObject]/[NewObject] annotations.
Adds RequestCache enum.
Ensures that cors-with-forced-preflight is translated to cors in getter.
Reject cors-with-forced-preflight as a valid mode value in Request constructor.

--HG--
extra : rebase_source : 0b621e13dc5cdbf740fb7d380f96f1380cd5a3eb
extra : amend_source : 7ced6d36ed7212271163c6aa1baacc7d5ca39647
2015-01-07 16:24:40 -08:00

45 lines
1.2 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "InternalRequest.h"
#include "nsIContentPolicy.h"
#include "nsIDocument.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/dom/workers/Workers.h"
#include "WorkerPrivate.h"
namespace mozilla {
namespace dom {
// The global is used to extract the principal.
already_AddRefed<InternalRequest>
InternalRequest::GetRequestConstructorCopy(nsIGlobalObject* aGlobal, ErrorResult& aRv) const
{
nsRefPtr<InternalRequest> copy = new InternalRequest();
copy->mURL.Assign(mURL);
copy->SetMethod(mMethod);
copy->mHeaders = new InternalHeaders(*mHeaders);
copy->mBodyStream = mBodyStream;
copy->mPreserveContentCodings = true;
copy->mContext = nsIContentPolicy::TYPE_FETCH;
copy->mMode = mMode;
copy->mCredentialsMode = mCredentialsMode;
copy->mCacheMode = mCacheMode;
return copy.forget();
}
InternalRequest::~InternalRequest()
{
}
} // namespace dom
} // namespace mozilla