chromium/third_party/leveldatabase/port/port_chromium.h

// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
//
// See port_example.h for documentation for the following types/functions.

#ifndef STORAGE_LEVELDB_PORT_PORT_CHROMIUM_H_
#define STORAGE_LEVELDB_PORT_PORT_CHROMIUM_H_

#include <cstddef>
#include <cstdint>
#include <string>

#include "base/check.h"
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
#include "base/thread_annotations.h"
#include "base/threading/thread_restrictions.h"

namespace leveldb {
namespace port {

class LOCKABLE Mutex {};

// Thinly wraps base::ConditionVariable.
class CondVar {};

bool Snappy_Compress(const char* input, size_t input_length,
                     std::string* output);
bool Snappy_GetUncompressedLength(const char* input, size_t length,
                                  size_t* result);
bool Snappy_Uncompress(const char* input_data, size_t input_length,
                       char* output);

inline bool Zstd_Compress(int level,
                          const char* input,
                          size_t length,
                          std::string* output) {}

inline bool Zstd_GetUncompressedLength(const char* input, size_t length,
                                       size_t* result) {}

inline bool Zstd_Uncompress(const char* input, size_t length, char* output) {}

inline bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg) {}

uint32_t AcceleratedCRC32C(uint32_t crc, const char* buf, size_t size);

}  // namespace port
}  // namespace leveldb

#endif  // STORAGE_LEVELDB_PORT_PORT_CHROMIUM_H_