ssl_key_logger_impl.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2018 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_SSL_SSL_KEY_LOGGER_IMPL_H_
  5. #define NET_SSL_SSL_KEY_LOGGER_IMPL_H_
  6. #include <memory>
  7. #include <string>
  8. #include "base/files/file.h"
  9. #include "base/memory/scoped_refptr.h"
  10. #include "net/base/net_export.h"
  11. #include "net/ssl/ssl_key_logger.h"
  12. namespace base {
  13. class FilePath;
  14. } // namespace base
  15. namespace net {
  16. // SSLKeyLoggerImpl is the file-based implementation of the SSLKeyLogger
  17. // interface.
  18. class NET_EXPORT SSLKeyLoggerImpl : public SSLKeyLogger {
  19. public:
  20. // Creates a new SSLKeyLoggerImpl which writes to |path|, scheduling write
  21. // operations in the background.
  22. explicit SSLKeyLoggerImpl(const base::FilePath& path);
  23. // Creates a new SSLKeyLoggerImpl which writes to |file|, scheduling write
  24. // operations in the background.
  25. explicit SSLKeyLoggerImpl(base::File file);
  26. SSLKeyLoggerImpl(const SSLKeyLoggerImpl&) = delete;
  27. SSLKeyLoggerImpl& operator=(const SSLKeyLoggerImpl&) = delete;
  28. ~SSLKeyLoggerImpl() override;
  29. void WriteLine(const std::string& line) override;
  30. private:
  31. class Core;
  32. scoped_refptr<Core> core_;
  33. };
  34. } // namespace net
  35. #endif // NET_SSL_SSL_KEY_LOGGER_IMPL_H_