Skip to content

Commit

Permalink
Add out-of-line copy ctors for complex classes. (new in win_clang)
Browse files Browse the repository at this point in the history
This patch adds out of line copy constructors for classes that our
clang-plugin considers heavy. This is an effort to enable copy
constructor checks by default.

BUG=436357
R=dcheng@chromium.org, thakis@chromium.org
TBR=jochen@chromium.org, sievers@chromium.org, mcasas@chromium.org, alekseys@chromium.org, cpu@chromium.org

Review URL: https://codereview.chromium.org/1886923002

Cr-Commit-Position: refs/heads/master@{#387193}
  • Loading branch information
vmpstr authored and Commit bot committed Apr 14, 2016
1 parent 048fcf6 commit bcdec0d
Show file tree
Hide file tree
Showing 24 changed files with 50 additions and 0 deletions.
3 changes: 3 additions & 0 deletions base/win/shortcut.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ ShortcutProperties::ShortcutProperties()
: icon_index(-1), dual_mode(false), options(0U) {
}

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

ShortcutProperties::~ShortcutProperties() {
}

Expand Down
1 change: 1 addition & 0 deletions base/win/shortcut.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ struct BASE_EXPORT ShortcutProperties {
};

ShortcutProperties();
ShortcutProperties(const ShortcutProperties& other);
~ShortcutProperties();

void set_target(const FilePath& target_in) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ MTPDeviceDelegateImplWin::PendingTaskInfo::PendingTaskInfo(
reply(reply) {
}

MTPDeviceDelegateImplWin::PendingTaskInfo::PendingTaskInfo(
const PendingTaskInfo& other) = default;

MTPDeviceDelegateImplWin::PendingTaskInfo::~PendingTaskInfo() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class MTPDeviceDelegateImplWin : public MTPDeviceAsyncDelegate {
PendingTaskInfo(const tracked_objects::Location& location,
const base::Callback<base::File::Error(void)>& task,
const base::Callback<void(base::File::Error)>& reply);
PendingTaskInfo(const PendingTaskInfo& other);
~PendingTaskInfo();

const tracked_objects::Location location;
Expand Down
6 changes: 6 additions & 0 deletions chrome/browser/media_galleries/win/snapshot_file_details.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ SnapshotRequestInfo::SnapshotRequestInfo(
error_callback(error_callback) {
}

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

SnapshotRequestInfo::~SnapshotRequestInfo() {
}

Expand All @@ -38,6 +41,9 @@ SnapshotFileDetails::SnapshotFileDetails(
bytes_written_(0) {
}

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

SnapshotFileDetails::~SnapshotFileDetails() {
file_stream_.Release();
}
Expand Down
2 changes: 2 additions & 0 deletions chrome/browser/media_galleries/win/snapshot_file_details.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct SnapshotRequestInfo {
const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback&
success_callback,
const MTPDeviceAsyncDelegate::ErrorCallback& error_callback);
SnapshotRequestInfo(const SnapshotRequestInfo& other);
~SnapshotRequestInfo();

// Device file path.
Expand All @@ -38,6 +39,7 @@ struct SnapshotRequestInfo {
class SnapshotFileDetails {
public:
explicit SnapshotFileDetails(const SnapshotRequestInfo& request_info);
SnapshotFileDetails(const SnapshotFileDetails& other);
~SnapshotFileDetails();

void set_file_info(const base::File::Info& file_info);
Expand Down
3 changes: 3 additions & 0 deletions chrome/browser/net/service_providers_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
WinsockLayeredServiceProvider::WinsockLayeredServiceProvider() {
}

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

WinsockLayeredServiceProvider::~WinsockLayeredServiceProvider() {
}

Expand Down
1 change: 1 addition & 0 deletions chrome/browser/net/service_providers_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ typedef std::vector<WinsockNamespaceProvider> WinsockNamespaceProviderList;

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

base::string16 name;
Expand Down
3 changes: 3 additions & 0 deletions chrome/installer/util/shell_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,9 @@ ShellUtil::ShortcutProperties::ShortcutProperties(ShellChange level_in)
pin_to_taskbar(false),
options(0U) {}

ShellUtil::ShortcutProperties::ShortcutProperties(
const ShortcutProperties& other) = default;

ShellUtil::ShortcutProperties::~ShortcutProperties() {
}

Expand Down
1 change: 1 addition & 0 deletions chrome/installer/util/shell_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class ShellUtil {
};

explicit ShortcutProperties(ShellChange level_in);
ShortcutProperties(const ShortcutProperties& other);
~ShortcutProperties();

// Sets the target executable to launch from this shortcut.
Expand Down
2 changes: 2 additions & 0 deletions components/os_crypt/ie7_password_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ struct PasswordEntry {
IE7PasswordInfo::IE7PasswordInfo() {
}

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

IE7PasswordInfo::~IE7PasswordInfo() {
}

Expand Down
1 change: 1 addition & 0 deletions components/os_crypt/ie7_password_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// Contains the information read from the IE7/IE8 Storage2 key in the registry.
struct IE7PasswordInfo {
IE7PasswordInfo();
IE7PasswordInfo(const IE7PasswordInfo& other);
~IE7PasswordInfo();

// Hash of the url.
Expand Down
3 changes: 3 additions & 0 deletions components/storage_monitor/portable_device_watcher_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,9 @@ PortableDeviceWatcherWin::DeviceStorageObject::DeviceStorageObject(
PortableDeviceWatcherWin::DeviceDetails::DeviceDetails() {
}

PortableDeviceWatcherWin::DeviceDetails::DeviceDetails(
const DeviceDetails& other) = default;

PortableDeviceWatcherWin::DeviceDetails::~DeviceDetails() {
}

Expand Down
1 change: 1 addition & 0 deletions components/storage_monitor/portable_device_watcher_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class PortableDeviceWatcherWin {
// Struct to store attached MTP device details.
struct DeviceDetails {
DeviceDetails();
DeviceDetails(const DeviceDetails& other);
~DeviceDetails();

// Device name.
Expand Down
3 changes: 3 additions & 0 deletions content/common/gpu/media/dxva_video_decode_accelerator_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,9 @@ DXVAVideoDecodeAccelerator::PendingSampleInfo::PendingSampleInfo(
output_sample.Attach(sample);
}

DXVAVideoDecodeAccelerator::PendingSampleInfo::PendingSampleInfo(
const PendingSampleInfo& other) = default;

DXVAVideoDecodeAccelerator::PendingSampleInfo::~PendingSampleInfo() {}

DXVAVideoDecodeAccelerator::DXVAVideoDecodeAccelerator(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ class CONTENT_EXPORT DXVAVideoDecodeAccelerator
// Contains information about a decoded sample.
struct PendingSampleInfo {
PendingSampleInfo(int32_t buffer_id, IMFSample* sample);
PendingSampleInfo(const PendingSampleInfo& other);
~PendingSampleInfo();

int32_t input_buffer_id;
Expand Down
2 changes: 2 additions & 0 deletions content/test/dwrite_font_fake_sender_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ IPC::Sender* CreateFakeCollectionSender() {

FakeFont::FakeFont(const base::string16& name) : font_name_(name) {}

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

FakeFont::~FakeFont() = default;

FakeFontCollection::FakeFontCollection() = default;
Expand Down
2 changes: 2 additions & 0 deletions content/test/dwrite_font_fake_sender_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class FakeFont {
public:
explicit FakeFont(const base::string16& name);

FakeFont(const FakeFont& other);

~FakeFont();

FakeFont& AddFilePath(const base::string16& file_path) {
Expand Down
2 changes: 2 additions & 0 deletions media/capture/video/video_capture_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ VideoCaptureDevice::Name::Name(const std::string& name,
}
#endif

VideoCaptureDevice::Name::Name(const Name& other) = default;

VideoCaptureDevice::Name::~Name() {
}

Expand Down
1 change: 1 addition & 0 deletions media/capture/video/video_capture_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class MEDIA_EXPORT VideoCaptureDevice {
const CaptureApiType api_type,
const TransportType transport_type);
#endif
Name(const Name& other);
~Name();

// Friendly name of a device
Expand Down
3 changes: 3 additions & 0 deletions printing/backend/print_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ PrinterSemanticCapsAndDefaults::PrinterSemanticCapsAndDefaults()
bw_model(UNKNOWN_COLOR_MODEL)
{}

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

PrinterSemanticCapsAndDefaults::~PrinterSemanticCapsAndDefaults() {}

PrinterCapsAndDefaults::PrinterCapsAndDefaults() {}
Expand Down
1 change: 1 addition & 0 deletions printing/backend/print_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ typedef std::vector<PrinterBasicInfo> PrinterList;

struct PRINTING_EXPORT PrinterSemanticCapsAndDefaults {
PrinterSemanticCapsAndDefaults();
PrinterSemanticCapsAndDefaults(const PrinterSemanticCapsAndDefaults& other);
~PrinterSemanticCapsAndDefaults();

bool collate_capable;
Expand Down
3 changes: 3 additions & 0 deletions sandbox/win/src/interception.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ const char kUnloadDLLDummyFunction[] = "@";
InterceptionManager::InterceptionData::InterceptionData() {
}

InterceptionManager::InterceptionData::InterceptionData(
const InterceptionData& other) = default;

InterceptionManager::InterceptionData::~InterceptionData() {
}

Expand Down
1 change: 1 addition & 0 deletions sandbox/win/src/interception.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ class InterceptionManager {
// Used to store the interception information until the actual set-up.
struct InterceptionData {
InterceptionData();
InterceptionData(const InterceptionData& other);
~InterceptionData();

InterceptionType type; // Interception type.
Expand Down

0 comments on commit bcdec0d

Please sign in to comment.