/* -*- 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/. */
// ---------------------------------------------------- // | Flags | Load Type | // ---------------------------------------------------- // | nsIClassOfService::Leader | A | // | w/o nsIRequest::LOAD_BACKGROUND | B | // | w/ nsIRequest::LOAD_BACKGROUND | C | // ---------------------------------------------------- // | Category | List Category | // ---------------------------------------------------- // | Basic Disconnected List | I | // | Content | II | // | Fingerprinting | III | // ---------------------------------------------------- // ==================================================== // | Normal Mode | // ---------------------------------------------------- // | Y = 0 for system principals | // | Y = 1 for first party | // | Y = 2 for non-listed third party type | // ---------------------------------------------------- // | \Y\ | Type A | Type B | Type C | // ---------------------------------------------------- // | Category I | 3 | 4 | 5 | // | Category II | 6 | 7 | 8 | // | Category III | 9 | 10 | 11 | // ==================================================== // | Private Mode | // ---------------------------------------------------- // | Y = 12 for system principals | // | Y = 13 for first party | // | Y = 14 for non-listed third party type | // ---------------------------------------------------- // | \Y\ | Type A | Type B | Type C | // ---------------------------------------------------- // | Category I | 15 | 16 | 17 | // | Category II | 18 | 19 | 20 | // | Category III | 21 | 22 | 23 | // ====================================================
// divide categories into 4 parts: // 1) normal 1st-party (Y in {0, 1}) // 2) normal 3rd-party (1 < Y < 12) // 3) private 1st-party (Y in {12, 13}) // 4) private 3rd-party (13 < Y < 24) // Normal and private transaction should not share the same connection, // and we choose 3rd-party prior than 1st-party.
HttpTrafficCategory best = categories[0]; for (auto category : categories) {
MOZ_ASSERT(category != HttpTrafficCategory::eInvalid, "invalid category");
if (category == 0 || category == 1 || category == 12 || category == 13) { // first party
MOZ_ASSERT(gKeyName[category].EqualsLiteral("Y0_N1Sys") ||
gKeyName[category].EqualsLiteral("Y1_N1") ||
gKeyName[category].EqualsLiteral("Y12_P1Sys") ||
gKeyName[category].EqualsLiteral("Y13_P1")); continue;
} // third party
MOZ_ASSERT(gKeyName[24].Equals(kInvalidCategory), "category definition isn't consistent");
best = category; break;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.