netwerk/protocol/http/PClassifierDummyChannel.ipdl
author Andrea Marchesini <amarchesini@mozilla.com>
Fri, 15 Mar 2019 18:55:10 +0000
changeset 525320 8e01eb4f12c7701b7f7f389a9db3229606ba0179
parent 524913 netwerk/protocol/http/PTrackingDummyChannel.ipdl@a0c8d47ee188ee72fb0896dd80b02076f9bcafb5
permissions -rw-r--r--
Bug 1535525 - Rename TrackingDummyChannel to ClassifierDummyChannel, r=Ehsan Differential Revision: https://phabricator.services.mozilla.com/D23616

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 ft=cpp : */

/* 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 protocol PNecko;

namespace mozilla {
namespace net {

// This protocol provides a mechanism for the "child intercept" mode of
// ServiceWorker operation to work correctly with Classified channels.
// ServiceWorkers should not be allowed for third-party iframes which are
// annotated as tracking origins.
//
// In child intercept mode, the decision to intercept a channel is made in the
// child process without consulting the parent process.  The decision is based
// on whether there is a ServiceWorker with a scope covering the URL in question
// and whether storage is allowed for the origin/URL.  When the
// "network.cookie.cookieBehavior" preference is set to BEHAVIOR_REJECT_TRACKER,
// annotated channels are denied storage which means that the ServiceWorker
// should not intercept the channel.  However, the decision for tracking
// protection to annotate a channel only occurs in the parent process.  The
// dummy channel is a hack to allow the intercept decision process to ask the
// parent process if the channel should be annotated.  Because this round-trip
// to the parent has overhead, the dummy channel is only created 1) if the
// ServiceWorker initially determines that the channel should be intercepted and
// 2) it's a navigation request.
//
// This hack can be removed once Bug 1231208's new "parent intercept" mechanism
// fully lands, the pref is enabled by default it stays enabled for long enough
// to be confident we will never need/want to turn it off.  Then as part of bug
// 1496997 we can remove this implementation.  Bug 1498259 covers removing this
// hack in particular.
protocol PClassifierDummyChannel
{
  manager PNecko;

child:
  async __delete__(uint32_t aClassificationFlags);
};

} // namespace net
} // namespace mozilla