Bug 1525245 - Stabilize cookiePolicy/cookiePermission for live documents - part 12 - nsICookieSettings for the channel creation, r=ckerschb,asuth,Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D21538
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "mozilla/dom/WorkerCommon.h"
|
||||
#include "mozilla/ipc/BackgroundUtils.h"
|
||||
#include "mozilla/ipc/PBackgroundSharedTypes.h"
|
||||
#include "mozilla/net/CookieSettings.h"
|
||||
#include "nsICacheInfoChannel.h"
|
||||
#include "nsIHttpChannelInternal.h"
|
||||
#include "nsIStreamLoader.h"
|
||||
@@ -657,12 +658,17 @@ nsresult CompareNetwork::Initialize(nsIPrincipal* aPrincipal,
|
||||
mIsMainScript ? nsIContentPolicy::TYPE_INTERNAL_SERVICE_WORKER
|
||||
: nsIContentPolicy::TYPE_INTERNAL_WORKER_IMPORT_SCRIPTS;
|
||||
|
||||
// Create a new cookieSettings.
|
||||
nsCOMPtr<nsICookieSettings> cookieSettings =
|
||||
mozilla::net::CookieSettings::Create();
|
||||
|
||||
// Note that because there is no "serviceworker" RequestContext type, we can
|
||||
// use the TYPE_INTERNAL_SCRIPT content policy types when loading a service
|
||||
// worker.
|
||||
rv = NS_NewChannel(getter_AddRefs(mChannel), uri, aPrincipal, secFlags,
|
||||
contentPolicyType, nullptr, /* aPerformanceStorage */
|
||||
loadGroup, nullptr /* aCallbacks */, mLoadFlags);
|
||||
contentPolicyType, cookieSettings,
|
||||
nullptr /* aPerformanceStorage */, loadGroup,
|
||||
nullptr /* aCallbacks */, mLoadFlags);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user