blob: 049ce1242965feffa586db08d214c1ec5b19575c [file] [log] [blame]
Avi Drissman64595482022-09-14 20:52:291// Copyright 2011 The Chromium Authors
license.botbf09a502008-08-24 00:55:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
initial.commit586acc5fe2008-07-26 22:42:524
5#ifndef NET_BASE_LOAD_STATES_H__
6#define NET_BASE_LOAD_STATES_H__
7
Jan Wilken Dörriead587c32021-03-11 14:09:278#include <string>
9
[email protected]9c235f042011-08-10 22:28:2110
initial.commit586acc5fe2008-07-26 22:42:5211namespace net {
12
13// These states correspond to the lengthy periods of time that a resource load
14// may be blocked and unable to make progress.
15enum LoadState {
initial.commit586acc5fe2008-07-26 22:42:5216
xunjieliab63f6912015-06-23 23:03:0117#define LOAD_STATE(label, value) LOAD_STATE_##label,
[email protected]3ecb49d72012-11-06 19:56:5418#include "net/base/load_states_list.h"
19#undef LOAD_STATE
[email protected]9c235f042011-08-10 22:28:2120
initial.commit586acc5fe2008-07-26 22:42:5221};
22
[email protected]9c235f042011-08-10 22:28:2123// Some states, like LOAD_STATE_WAITING_FOR_DELEGATE, are associated with extra
24// data that describes more precisely what the delegate (for example) is doing.
25// This class provides an easy way to hold a load state with an extra parameter.
26struct LoadStateWithParam {
27 LoadState state;
Jan Wilken Dörrie739ccc212021-03-11 18:13:0528 std::u16string param;
[email protected]c7bf7452011-09-12 21:31:5029 LoadStateWithParam() : state(LOAD_STATE_IDLE) {}
Jan Wilken Dörrie739ccc212021-03-11 18:13:0530 LoadStateWithParam(LoadState state, const std::u16string& param)
[email protected]9c235f042011-08-10 22:28:2131 : state(state), param(param) {}
32};
33
initial.commit586acc5fe2008-07-26 22:42:5234} // namespace net
35
36#endif // NET_BASE_LOAD_STATES_H__