chromium/printing/backend/print_backend_cups.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "printing/backend/print_backend_cups.h"

#include <cups/cups.h>
#include <cups/ppd.h>
#include <dlfcn.h>
#include <errno.h>
#include <pthread.h>

#include <string>
#include <string_view>

#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/memory/scoped_refptr.h"
#include "base/no_destructor.h"
#include "base/strings/string_number_conversions.h"
#include "base/synchronization/lock.h"
#include "build/build_config.h"
#include "printing/backend/cups_helper.h"
#include "printing/backend/cups_weak_functions.h"
#include "printing/backend/print_backend_consts.h"
#include "printing/backend/print_backend_utils.h"
#include "printing/mojom/print.mojom.h"
#include "url/gurl.h"

#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)
#include "base/feature_list.h"
#include "printing/backend/cups_connection.h"
#include "printing/backend/print_backend_cups_ipp.h"
#include "printing/printing_features.h"
#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC)

namespace printing {

namespace {

struct CupsDestsData {};

int CaptureCupsDestCallback(void* data, unsigned flags, cups_dest_t* dest) {}

}  // namespace

PrintBackendCUPS::PrintBackendCUPS(const GURL& print_server_url,
                                   http_encryption_t encryption,
                                   bool blocking,
                                   const std::string& locale)
    :{}

PrintBackendCUPS::~PrintBackendCUPS() = default;

// static
mojom::ResultCode PrintBackendCUPS::PrinterBasicInfoFromCUPS(
    const cups_dest_t& printer,
    PrinterBasicInfo* printer_info) {}

// static
std::string PrintBackendCUPS::PrinterDriverInfoFromCUPS(
    const cups_dest_t& printer) {}

mojom::ResultCode PrintBackendCUPS::EnumeratePrinters(
    PrinterList& printer_list) {}

mojom::ResultCode PrintBackendCUPS::GetDefaultPrinterName(
    std::string& default_printer) {}

mojom::ResultCode PrintBackendCUPS::GetPrinterBasicInfo(
    const std::string& printer_name,
    PrinterBasicInfo* printer_info) {}

mojom::ResultCode PrintBackendCUPS::GetPrinterSemanticCapsAndDefaults(
    const std::string& printer_name,
    PrinterSemanticCapsAndDefaults* printer_info) {}

std::string PrintBackendCUPS::GetPrinterCapabilities(
    const std::string& printer_name) {}

std::vector<std::string> PrintBackendCUPS::GetPrinterDriverInfo(
    const std::string& printer_name) {}

bool PrintBackendCUPS::IsValidPrinter(const std::string& printer_name) {}

#if !BUILDFLAG(IS_CHROMEOS)
scoped_refptr<PrintBackend> PrintBackend::CreateInstanceImpl(
    const std::string& locale) {}
#endif  // !BUILDFLAG(IS_CHROMEOS)

int PrintBackendCUPS::GetDests(cups_dest_t** dests) {}

base::FilePath PrintBackendCUPS::GetPPD(const char* name) {}

ScopedDestination PrintBackendCUPS::GetNamedDest(
    const std::string& printer_name) {}

}  // namespace printing