1/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
3
4/* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7
8include protocol PNecko;
9
10namespace mozilla {
11namespace net {
12
13// This protocol provides a mechanism for the "child intercept" mode of
14// ServiceWorker operation to work correctly with Classified channels.
15// ServiceWorkers should not be allowed for third-party iframes which are
16// annotated as tracking origins.
17//
18// In child intercept mode, the decision to intercept a channel is made in the
19// child process without consulting the parent process.  The decision is based
20// on whether there is a ServiceWorker with a scope covering the URL in question
21// and whether storage is allowed for the origin/URL.  When the
22// "network.cookie.cookieBehavior" preference is set to BEHAVIOR_REJECT_TRACKER,
23// annotated channels are denied storage which means that the ServiceWorker
24// should not intercept the channel.  However, the decision for tracking
25// protection to annotate a channel only occurs in the parent process.  The
26// dummy channel is a hack to allow the intercept decision process to ask the
27// parent process if the channel should be annotated.  Because this round-trip
28// to the parent has overhead, the dummy channel is only created 1) if the
29// ServiceWorker initially determines that the channel should be intercepted and
30// 2) it's a navigation request.
31//
32// This hack can be removed once Bug 1231208's new "parent intercept" mechanism
33// fully lands, the pref is enabled by default it stays enabled for long enough
34// to be confident we will never need/want to turn it off.  Then as part of bug
35// 1496997 we can remove this implementation.  Bug 1498259 covers removing this
36// hack in particular.
37protocol PClassifierDummyChannel
38{
39  manager PNecko;
40
41child:
42  async __delete__(uint32_t aClassificationFlags);
43};
44
45} // namespace net
46} // namespace mozilla
47
48