15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 54e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#ifndef NET_BASE_REQUEST_PRIORITY_H_ 64e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#define NET_BASE_REQUEST_PRIORITY_H_ 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 8a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "net/base/net_export.h" 9a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace net { 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Prioritization used in various parts of the networking code such 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// as connection prioritization and resource loading prioritization. 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)enum RequestPriority { 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IDLE = 0, 162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) MINIMUM_PRIORITY = IDLE, 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) LOWEST, 182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) DEFAULT_PRIORITY = LOWEST, 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) LOW, 205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) MEDIUM, 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) HIGHEST, 228bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) MAXIMUM_PRIORITY = HIGHEST, 238bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)}; 248bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) 258bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)// For simplicity, one can assume that one can index into array of 268bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)// NUM_PRIORITIES elements with a RequestPriority (i.e., 278bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)// MINIMUM_PRIORITY == 0). 288bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)enum RequestPrioritySize { 298bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles) NUM_PRIORITIES = MAXIMUM_PRIORITY + 1, 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}; 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 32a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)NET_EXPORT const char* RequestPriorityToString(RequestPriority priority); 334e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace net 355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 364e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#endif // NET_BASE_REQUEST_PRIORITY_H_ 37