chromium/extensions/browser/error_map.cc

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

#include "extensions/browser/error_map.h"

#include <utility>

#include "base/lazy_instance.h"
#include "extensions/common/extension_id.h"

namespace extensions {

namespace {

// The maximum number of errors to be stored per extension.
const size_t kMaxErrorsPerExtension =;

base::LazyInstance<ErrorList>::DestructorAtExit g_empty_error_list =;

// An incrementing counter for the next error id. Overflowing this is very
// unlikely, since the number of errors per extension is capped at 100.
int g_next_error_id =;

}  // namespace

////////////////////////////////////////////////////////////////////////////////
// ErrorMap::Filter
ErrorMap::Filter::Filter(const ExtensionId& restrict_to_extension_id,
                         int restrict_to_type,
                         const std::set<int>& restrict_to_ids,
                         bool restrict_to_incognito)
    :{}

ErrorMap::Filter::Filter(const Filter& other) = default;

ErrorMap::Filter::~Filter() {}

ErrorMap::Filter ErrorMap::Filter::ErrorsForExtension(
    const ExtensionId& extension_id) {}

ErrorMap::Filter ErrorMap::Filter::ErrorsForExtensionWithType(
    const ExtensionId& extension_id,
    ExtensionError::Type type) {}

ErrorMap::Filter ErrorMap::Filter::ErrorsForExtensionWithIds(
    const ExtensionId& extension_id,
    const std::set<int>& ids) {}

ErrorMap::Filter ErrorMap::Filter::ErrorsForExtensionWithTypeAndIds(
    const ExtensionId& extension_id,
    ExtensionError::Type type,
    const std::set<int>& ids) {}

ErrorMap::Filter ErrorMap::Filter::IncognitoErrors() {}

bool ErrorMap::Filter::Matches(const ExtensionError* error) const {}

////////////////////////////////////////////////////////////////////////////////
// ErrorMap::ExtensionEntry
class ErrorMap::ExtensionEntry {};

ErrorMap::ExtensionEntry::ExtensionEntry() {}

ErrorMap::ExtensionEntry::~ExtensionEntry() {}

bool ErrorMap::ExtensionEntry::DeleteErrors(const Filter& filter) {}

void ErrorMap::ExtensionEntry::DeleteAllErrors() {}

const ExtensionError* ErrorMap::ExtensionEntry::AddError(
    std::unique_ptr<ExtensionError> error) {}

////////////////////////////////////////////////////////////////////////////////
// ErrorMap
ErrorMap::ErrorMap() {}

ErrorMap::~ErrorMap() {}

const ErrorList& ErrorMap::GetErrorsForExtension(
    const ExtensionId& extension_id) const {}

const ExtensionError* ErrorMap::AddError(
    std::unique_ptr<ExtensionError> error) {}

void ErrorMap::RemoveErrors(const Filter& filter,
                            std::set<ExtensionId>* affected_ids) {}

void ErrorMap::RemoveAllErrors() {}

}  // namespace extensions