chromium/content/browser/indexed_db/indexed_db_reporting.h

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_REPORTING_H_
#define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_REPORTING_H_

#include <string>

#include "base/logging.h"
#include "third_party/leveldatabase/src/include/leveldb/status.h"

namespace storage {
struct BucketLocator;
}  // namespace storage

namespace content {
namespace indexed_db {
constexpr static const char* kBackingStoreActionUmaName =;

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum IndexedDBBackingStoreErrorSource {};

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused. Commented out values are deprecated.
enum IndexedDBBackingStoreOpenResult {};

// These values are used for UMA metrics and should never be changed.
enum class IndexedDBAction {};

void ReportOpenStatus(IndexedDBBackingStoreOpenResult result,
                      const storage::BucketLocator& bucket_locator);

void ReportInternalError(const char* type,
                         IndexedDBBackingStoreErrorSource location);

void ReportLevelDBError(const std::string& histogram_name,
                        const leveldb::Status& s);

// Use to signal conditions caused by data corruption.
// A macro is used instead of an inline function so that the assert and log
// report the line number.
#define REPORT_ERROR(type, location)

#define INTERNAL_READ_ERROR(location)
#define INTERNAL_CONSISTENCY_ERROR(location)
#define INTERNAL_WRITE_ERROR(location)

}  // namespace indexed_db
}  // namespace content

#endif  // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_REPORTING_H_