Skip to content

Commit

Permalink
Disallow copy/assign for PpdProviderQueueEntry's
Browse files Browse the repository at this point in the history
These QueueEntry's hold base::OnceCallback's so they can't be
copied/assigned; structs now reflect that.

Bug: chromium:922852
Test: PpdProvider tests still pass
Change-Id: I01ebd72df0a441043951b4b77bf9f3b40f686599
Reviewed-on: https://chromium-review.googlesource.com/c/1417992
Auto-Submit: Luum Habtemariam <luum@chromium.org>
Commit-Queue: Sean Kau <skau@chromium.org>
Reviewed-by: Sean Kau <skau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624403}
  • Loading branch information
Luum Habtemariam authored and Commit Bot committed Jan 19, 2019
1 parent e955a24 commit ac4281c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions chromeos/printing/ppd_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ struct PpdIndexJSON {
};

// A queued request to download printer information for a manufacturer.
// Note: Disabled copying/assigning since this holds a base::OnceCalback.
struct PrinterResolutionQueueEntry {
PrinterResolutionQueueEntry() = default;
PrinterResolutionQueueEntry(PrinterResolutionQueueEntry&& other) = default;
~PrinterResolutionQueueEntry() = default;

// Localized manufacturer name
std::string manufacturer;

Expand All @@ -105,10 +110,17 @@ struct PrinterResolutionQueueEntry {

// User callback on completion.
PpdProvider::ResolvePrintersCallback cb;

DISALLOW_COPY_AND_ASSIGN(PrinterResolutionQueueEntry);
};

// A queued request to download reverse index information for a make and model
// Note: Disabled copying/assigning since this holds a base::OnceCalback.
struct ReverseIndexQueueEntry {
ReverseIndexQueueEntry() = default;
ReverseIndexQueueEntry(ReverseIndexQueueEntry&& other) = default;
~ReverseIndexQueueEntry() = default;

// Canonical Printer Name
std::string effective_make_and_model;

Expand All @@ -117,6 +129,8 @@ struct ReverseIndexQueueEntry {

// User callback on completion.
PpdProvider::ReverseLookupCallback cb;

DISALLOW_COPY_AND_ASSIGN(ReverseIndexQueueEntry);
};

// Holds manufacturer to printers relation
Expand All @@ -131,7 +145,12 @@ struct ManufacturerMetadata {
};

// Carried information for an inflight PPD resolution.
// Note: Disabled copying/assigning since this holds a base::OnceCalback.
struct PpdResolutionQueueEntry {
PpdResolutionQueueEntry() = default;
PpdResolutionQueueEntry(PpdResolutionQueueEntry&& other) = default;
~PpdResolutionQueueEntry() = default;

// Original reference being resolved.
Printer::PpdReference reference;

Expand All @@ -140,10 +159,18 @@ struct PpdResolutionQueueEntry {

// Callback to be invoked on completion.
PpdProvider::ResolvePpdCallback callback;

DISALLOW_COPY_AND_ASSIGN(PpdResolutionQueueEntry);
};

// Carried information for an inflight PPD reference resolution.
// Note: Disabled copying/assigning since this holds a base::OnceCalback.
struct PpdReferenceResolutionQueueEntry {
PpdReferenceResolutionQueueEntry() = default;
PpdReferenceResolutionQueueEntry(PpdReferenceResolutionQueueEntry&& other) =
default;
~PpdReferenceResolutionQueueEntry() = default;

// Metadata used to resolve to a unique PpdReference object.
PpdProvider::PrinterSearchData search_data;

Expand All @@ -152,6 +179,8 @@ struct PpdReferenceResolutionQueueEntry {

// Callback to be invoked on completion.
PpdProvider::ResolvePpdReferenceCallback cb;

DISALLOW_COPY_AND_ASSIGN(PpdReferenceResolutionQueueEntry);
};

// Extract cupsFilter/cupsFilter2 filter names from a line from a ppd.
Expand Down

0 comments on commit ac4281c

Please sign in to comment.