require_ct_delegate.h 905 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright (c) 2017 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef BRIGHTRAY_BROWSER_NET_REQUIRE_CT_DELEGATE_H_
  5. #define BRIGHTRAY_BROWSER_NET_REQUIRE_CT_DELEGATE_H_
  6. #include <set>
  7. #include <string>
  8. #include "net/http/transport_security_state.h"
  9. namespace brightray {
  10. class RequireCTDelegate
  11. : public net::TransportSecurityState::RequireCTDelegate {
  12. public:
  13. RequireCTDelegate();
  14. ~RequireCTDelegate() override;
  15. void AddCTExcludedHost(const std::string& host);
  16. void ClearCTExcludedHostsList();
  17. // net::TransportSecurityState::RequireCTDelegate:
  18. CTRequirementLevel IsCTRequiredForHost(const std::string& host) override;
  19. private:
  20. std::set<std::string> ct_excluded_hosts_;
  21. DISALLOW_COPY_AND_ASSIGN(RequireCTDelegate);
  22. };
  23. } // namespace brightray
  24. #endif // BRIGHTRAY_BROWSER_NET_REQUIRE_CT_DELEGATE_H_