nsNetSegmentUtils.h 653 B

123456789101112131415161718192021222324
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. #ifndef nsNetSegmentUtils_h__
  5. #define nsNetSegmentUtils_h__
  6. #include "nsIOService.h"
  7. /**
  8. * applies defaults to segment params in a consistent way.
  9. */
  10. static inline void
  11. net_ResolveSegmentParams(uint32_t &segsize, uint32_t &segcount)
  12. {
  13. if (!segsize)
  14. segsize = mozilla::net::nsIOService::gDefaultSegmentSize;
  15. if (!segcount)
  16. segcount = mozilla::net::nsIOService::gDefaultSegmentCount;
  17. }
  18. #endif // !nsNetSegmentUtils_h__