Avi Drissman | 6459548 | 2022-09-14 20:52:29 | [diff] [blame] | 1 | // Copyright 2011 The Chromium Authors |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
initial.commit | 586acc5fe | 2008-07-26 22:42:52 | [diff] [blame] | 4 | |
5 | #ifndef NET_BASE_LOAD_STATES_H__ | ||||
6 | #define NET_BASE_LOAD_STATES_H__ | ||||
7 | |||||
Jan Wilken Dörrie | ad587c3 | 2021-03-11 14:09:27 | [diff] [blame] | 8 | #include <string> |
9 | |||||
[email protected] | 9c235f04 | 2011-08-10 22:28:21 | [diff] [blame] | 10 | |
initial.commit | 586acc5fe | 2008-07-26 22:42:52 | [diff] [blame] | 11 | namespace 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. | ||||
15 | enum LoadState { | ||||
initial.commit | 586acc5fe | 2008-07-26 22:42:52 | [diff] [blame] | 16 | |
xunjieli | ab63f691 | 2015-06-23 23:03:01 | [diff] [blame] | 17 | #define LOAD_STATE(label, value) LOAD_STATE_##label, |
[email protected] | 3ecb49d7 | 2012-11-06 19:56:54 | [diff] [blame] | 18 | #include "net/base/load_states_list.h" |
19 | #undef LOAD_STATE | ||||
[email protected] | 9c235f04 | 2011-08-10 22:28:21 | [diff] [blame] | 20 | |
initial.commit | 586acc5fe | 2008-07-26 22:42:52 | [diff] [blame] | 21 | }; |
22 | |||||
[email protected] | 9c235f04 | 2011-08-10 22:28:21 | [diff] [blame] | 23 | // 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. | ||||
26 | struct LoadStateWithParam { | ||||
27 | LoadState state; | ||||
Jan Wilken Dörrie | 739ccc21 | 2021-03-11 18:13:05 | [diff] [blame] | 28 | std::u16string param; |
[email protected] | c7bf745 | 2011-09-12 21:31:50 | [diff] [blame] | 29 | LoadStateWithParam() : state(LOAD_STATE_IDLE) {} |
Jan Wilken Dörrie | 739ccc21 | 2021-03-11 18:13:05 | [diff] [blame] | 30 | LoadStateWithParam(LoadState state, const std::u16string& param) |
[email protected] | 9c235f04 | 2011-08-10 22:28:21 | [diff] [blame] | 31 | : state(state), param(param) {} |
32 | }; | ||||
33 | |||||
initial.commit | 586acc5fe | 2008-07-26 22:42:52 | [diff] [blame] | 34 | } // namespace net |
35 | |||||
36 | #endif // NET_BASE_LOAD_STATES_H__ |