load_states.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (c) 2011 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef NET_BASE_LOAD_STATES_H__
  5. #define NET_BASE_LOAD_STATES_H__
  6. #include <string>
  7. namespace net {
  8. // These states correspond to the lengthy periods of time that a resource load
  9. // may be blocked and unable to make progress.
  10. enum LoadState {
  11. #define LOAD_STATE(label, value) LOAD_STATE_##label,
  12. #include "net/base/load_states_list.h"
  13. #undef LOAD_STATE
  14. };
  15. // Some states, like LOAD_STATE_WAITING_FOR_DELEGATE, are associated with extra
  16. // data that describes more precisely what the delegate (for example) is doing.
  17. // This class provides an easy way to hold a load state with an extra parameter.
  18. struct LoadStateWithParam {
  19. LoadState state;
  20. std::u16string param;
  21. LoadStateWithParam() : state(LOAD_STATE_IDLE) {}
  22. LoadStateWithParam(LoadState state, const std::u16string& param)
  23. : state(state), param(param) {}
  24. };
  25. } // namespace net
  26. #endif // NET_BASE_LOAD_STATES_H__