internal_api_token.h 893 B

1234567891011121314151617181920212223242526272829303132
  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 SQL_INTERNAL_API_TOKEN_H_
  5. #define SQL_INTERNAL_API_TOKEN_H_
  6. namespace sql {
  7. namespace test {
  8. struct ColumnInfo;
  9. bool CorruptSizeInHeader(const base::FilePath&);
  10. } // namespace test
  11. // Restricts access to APIs internal to the //sql package.
  12. //
  13. // This implements Java's package-private via the passkey idiom.
  14. class InternalApiToken {
  15. private:
  16. // Must NOT be =default to disallow creation by uniform initialization.
  17. InternalApiToken() {}
  18. InternalApiToken(const InternalApiToken&) = default;
  19. friend class DatabaseTestPeer;
  20. friend class Recovery;
  21. friend struct test::ColumnInfo;
  22. friend bool test::CorruptSizeInHeader(const base::FilePath&);
  23. };
  24. } // namespace sql
  25. #endif // SQL_INTERNAL_API_TOKEN_H_