Skip to content

Commit

Permalink
Fix chromium-style Clang plugin complaints about CUPS code.
Browse files Browse the repository at this point in the history
Various structs are considered complex and requires explicit
ctors/dtor.

Review-Url: https://codereview.chromium.org/2818943002
Cr-Commit-Position: refs/heads/master@{#464858}
  • Loading branch information
leizleiz authored and Commit bot committed Apr 15, 2017
1 parent d9668fe commit 11a73bc
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ bool UpdateCurrentPage(const printing::CupsJob& job,

namespace chromeos {

QueryResult::QueryResult() = default;

QueryResult::QueryResult(const QueryResult& other) = default;

QueryResult::~QueryResult() = default;

CupsPrintJobManagerImpl::CupsPrintJobManagerImpl(Profile* profile)
: CupsPrintJobManager(profile),
cups_connection_(GURL(), HTTP_ENCRYPT_NEVER, false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ class Profile;
namespace chromeos {

struct QueryResult {
QueryResult();
QueryResult(const QueryResult& other);
~QueryResult();

bool success;
std::vector<::printing::QueueStatus> queues;
};
Expand Down
6 changes: 6 additions & 0 deletions printing/backend/cups_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ class DestinationEnumerator {

} // namespace

QueueStatus::QueueStatus() = default;

QueueStatus::QueueStatus(const QueueStatus& other) = default;

QueueStatus::~QueueStatus() = default;

CupsConnection::CupsConnection(const GURL& print_server_url,
http_encryption_t encryption,
bool blocking)
Expand Down
4 changes: 4 additions & 0 deletions printing/backend/cups_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ namespace printing {

// Represents the status of a printer queue.
struct PRINTING_EXPORT QueueStatus {
QueueStatus();
QueueStatus(const QueueStatus& other);
~QueueStatus();

PrinterStatus printer_status;
std::vector<CupsJob> jobs;
};
Expand Down
12 changes: 12 additions & 0 deletions printing/backend/cups_jobs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,18 @@ std::string PrinterUriFromName(const std::string& id) {

} // namespace

CupsJob::CupsJob() = default;

CupsJob::CupsJob(const CupsJob& other) = default;

CupsJob::~CupsJob() = default;

PrinterStatus::PrinterStatus() = default;

PrinterStatus::PrinterStatus(const PrinterStatus& other) = default;

PrinterStatus::~PrinterStatus() = default;

void ParseJobsResponse(ipp_t* response,
const std::string& printer_id,
std::vector<CupsJob>* jobs) {
Expand Down
10 changes: 9 additions & 1 deletion printing/backend/cups_jobs.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ struct PRINTING_EXPORT CupsJob {
ABORTED // an error occurred causing the printer to give up
};

CupsJob();
CupsJob(const CupsJob& other);
~CupsJob();

// job id
int id = -1;
// printer name in CUPS
Expand All @@ -47,7 +51,7 @@ struct PRINTING_EXPORT CupsJob {

// Represents the status of a printer containing the properties printer-state,
// printer-state-reasons, and printer-state-message.
struct PrinterStatus {
struct PRINTING_EXPORT PrinterStatus {
struct PrinterReason {
// Standardized reasons from RFC2911.
enum Reason {
Expand Down Expand Up @@ -94,6 +98,10 @@ struct PrinterStatus {
Severity severity;
};

PrinterStatus();
PrinterStatus(const PrinterStatus& other);
~PrinterStatus();

// printer-state
ipp_pstate_t state;
// printer-state-reasons
Expand Down

0 comments on commit 11a73bc

Please sign in to comment.