Skip to content

Commit

Permalink
Add more out of line copy ctors for complex classes.
Browse files Browse the repository at this point in the history
This patch adds the remaining copy constructors for complex classes.
After this patch, it should be possible to enable the heavy class copy
constructor checks by default.

R=thakis@chromium.org, dcheng@chromium.org
TBR=jam@chromium.org
BUG=436357
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

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

Cr-Commit-Position: refs/heads/master@{#383131}
  • Loading branch information
vmpstr authored and Commit bot committed Mar 24, 2016
1 parent 1b9ba3a commit bf0d713
Show file tree
Hide file tree
Showing 65 changed files with 124 additions and 1 deletion.
2 changes: 2 additions & 0 deletions blimp/client/session/assignment_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ Assignment GetAssignmentFromCommandLine() {

Assignment::Assignment() : transport_protocol(TransportProtocol::UNKNOWN) {}

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

Assignment::~Assignment() {}

bool Assignment::IsValid() const {
Expand Down
1 change: 1 addition & 0 deletions blimp/client/session/assignment_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct BLIMP_CLIENT_EXPORT Assignment {
};

Assignment();
Assignment(const Assignment& other);
~Assignment();

// Returns true if the net::IPEndPoint has an unspecified IP, port, or
Expand Down
2 changes: 2 additions & 0 deletions cc/layers/layer_list_iterator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ LayerListIterator::LayerListIterator(LayerImpl* root_layer)
list_indices_.push_back(0);
}

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

LayerListIterator::~LayerListIterator() {}

LayerListIterator& LayerListIterator::operator++() {
Expand Down
1 change: 1 addition & 0 deletions cc/layers/layer_list_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class LayerImpl;
class CC_EXPORT LayerListIterator {
public:
explicit LayerListIterator(LayerImpl* root_layer);
LayerListIterator(const LayerListIterator& other);
virtual ~LayerListIterator();

bool operator==(const LayerListIterator& other) const {
Expand Down
2 changes: 2 additions & 0 deletions cc/scheduler/scheduler_settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ SchedulerSettings::SchedulerSettings()
maximum_number_of_failed_draws_before_draw_is_forced(3),
background_frame_interval(base::TimeDelta::FromSeconds(1)) {}

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

SchedulerSettings::~SchedulerSettings() {}

scoped_ptr<base::trace_event::ConvertableToTraceFormat>
Expand Down
1 change: 1 addition & 0 deletions cc/scheduler/scheduler_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace cc {
class CC_EXPORT SchedulerSettings {
public:
SchedulerSettings();
SchedulerSettings(const SchedulerSettings& other);
~SchedulerSettings();

bool use_external_begin_frame_source;
Expand Down
3 changes: 3 additions & 0 deletions cc/surfaces/surface_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ namespace cc {
SurfaceManager::ClientSourceMapping::ClientSourceMapping()
: client(nullptr), source(nullptr) {}

SurfaceManager::ClientSourceMapping::ClientSourceMapping(
const ClientSourceMapping& other) = default;

SurfaceManager::ClientSourceMapping::~ClientSourceMapping() {
DCHECK(is_empty()) << "client: " << client
<< ", children: " << children.size();
Expand Down
1 change: 1 addition & 0 deletions cc/surfaces/surface_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class CC_SURFACES_EXPORT SurfaceManager {
// pointers guaranteed alive by callers until unregistered.
struct ClientSourceMapping {
ClientSourceMapping();
ClientSourceMapping(const ClientSourceMapping& other);
~ClientSourceMapping();
bool is_empty() const { return !client && !children.size(); }
// The client that's responsible for creating this namespace. Never null.
Expand Down
2 changes: 2 additions & 0 deletions cc/tiles/prioritized_tile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ PrioritizedTile::PrioritizedTile(
priority_(priority),
is_occluded_(is_occluded) {}

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

PrioritizedTile::~PrioritizedTile() {
}

Expand Down
1 change: 1 addition & 0 deletions cc/tiles/prioritized_tile.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class CC_EXPORT PrioritizedTile {
// This class is constructed and returned by a |PictureLayerTiling|, and
// represents a tile and its priority.
PrioritizedTile();
PrioritizedTile(const PrioritizedTile& other);
~PrioritizedTile();

Tile* tile() const { return tile_; }
Expand Down
3 changes: 3 additions & 0 deletions cc/tiles/software_image_decode_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,9 @@ ImageDecodeControllerKey::ImageDecodeControllerKey(
}
}

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

std::string ImageDecodeControllerKey::ToString() const {
std::ostringstream str;
str << "id[" << image_id_ << "] src_rect[" << src_rect_.x() << ","
Expand Down
2 changes: 2 additions & 0 deletions cc/tiles/software_image_decode_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class CC_EXPORT ImageDecodeControllerKey {
public:
static ImageDecodeControllerKey FromDrawImage(const DrawImage& image);

ImageDecodeControllerKey(const ImageDecodeControllerKey& other);

bool operator==(const ImageDecodeControllerKey& other) const {
// The image_id always has to be the same. However, after that all original
// decodes are the same, so if we can use the original decode, return true.
Expand Down
4 changes: 4 additions & 0 deletions cc/trees/property_tree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,8 @@ ScrollTree::ScrollTree()
: currently_scrolling_node_id_(-1),
layer_id_to_scroll_offset_map_(ScrollTree::ScrollOffsetMap()) {}

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

ScrollTree::~ScrollTree() {}

ScrollTree& ScrollTree::operator=(const ScrollTree& from) {
Expand Down Expand Up @@ -1720,6 +1722,8 @@ PropertyTrees::PropertyTrees()
scroll_tree.SetPropertyTrees(this);
}

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

PropertyTrees::~PropertyTrees() {}

bool PropertyTrees::operator==(const PropertyTrees& other) const {
Expand Down
2 changes: 2 additions & 0 deletions cc/trees/property_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ class CC_EXPORT EffectTree final : public PropertyTree<EffectNode> {
class CC_EXPORT ScrollTree final : public PropertyTree<ScrollNode> {
public:
ScrollTree();
ScrollTree(const ScrollTree& other);
~ScrollTree() override;

ScrollTree& operator=(const ScrollTree& from);
Expand Down Expand Up @@ -619,6 +620,7 @@ class CC_EXPORT ScrollTree final : public PropertyTree<ScrollNode> {
class CC_EXPORT PropertyTrees final {
public:
PropertyTrees();
PropertyTrees(const PropertyTrees& other);
~PropertyTrees();

bool operator==(const PropertyTrees& other) const;
Expand Down
3 changes: 3 additions & 0 deletions chrome/browser/ui/input_method/input_method_engine_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ void GetExtensionKeyboardEventFromKeyEvent(
InputMethodEngineBase::KeyboardEvent::KeyboardEvent()
: alt_key(false), ctrl_key(false), shift_key(false), caps_lock(false) {}

InputMethodEngineBase::KeyboardEvent::KeyboardEvent(
const KeyboardEvent& other) = default;

InputMethodEngineBase::KeyboardEvent::~KeyboardEvent() {}

InputMethodEngineBase::InputMethodEngineBase()
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/ui/input_method/input_method_engine_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class InputMethodEngineBase : virtual public ui::IMEEngineHandlerInterface {
public:
struct KeyboardEvent {
KeyboardEvent();
KeyboardEvent(const KeyboardEvent& other);
virtual ~KeyboardEvent();

std::string type;
Expand Down
2 changes: 2 additions & 0 deletions components/autofill/core/browser/field_candidates.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ FieldCandidate::FieldCandidate(ServerFieldType field_type, float field_score)

FieldCandidates::FieldCandidates() {}

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

FieldCandidates::~FieldCandidates() {}

void FieldCandidates::AddFieldCandidate(ServerFieldType type, float score) {
Expand Down
1 change: 1 addition & 0 deletions components/autofill/core/browser/field_candidates.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ struct FieldCandidate {
class FieldCandidates {
public:
FieldCandidates();
FieldCandidates(const FieldCandidates& other);
~FieldCandidates();

// Includes a possible |type| for a given field.
Expand Down
2 changes: 2 additions & 0 deletions components/mus/ws/platform_display_init_params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace mus {
namespace ws {

PlatformDisplayInitParams::PlatformDisplayInitParams() {}
PlatformDisplayInitParams::PlatformDisplayInitParams(
const PlatformDisplayInitParams& other) = default;
PlatformDisplayInitParams::~PlatformDisplayInitParams() {}

} // namespace ws
Expand Down
1 change: 1 addition & 0 deletions components/mus/ws/platform_display_init_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace ws {

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

mojo::Connector* connector = nullptr;
Expand Down
4 changes: 4 additions & 0 deletions components/mus/ws/test_change_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ Change::Change()
bool_value(false),
change_id(0u) {}

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

Change::~Change() {}

TestChangeTracker::TestChangeTracker() : delegate_(NULL) {}
Expand Down Expand Up @@ -391,6 +393,8 @@ void TestChangeTracker::AddChange(const Change& change) {

TestWindow::TestWindow() {}

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

TestWindow::~TestWindow() {}

std::string TestWindow::ToString() const {
Expand Down
2 changes: 2 additions & 0 deletions components/mus/ws/test_change_tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ enum ChangeType {
// TODO(sky): consider nuking and converting directly to WindowData.
struct TestWindow {
TestWindow();
TestWindow(const TestWindow& other);
~TestWindow();

// Returns a string description of this.
Expand All @@ -65,6 +66,7 @@ struct TestWindow {
// fields that are used.
struct Change {
Change();
Change(const Change& other);
~Change();

ChangeType type;
Expand Down
2 changes: 2 additions & 0 deletions components/page_load_metrics/common/page_load_timing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ namespace page_load_metrics {

PageLoadTiming::PageLoadTiming() {}

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

PageLoadTiming::~PageLoadTiming() {}

bool PageLoadTiming::operator==(const PageLoadTiming& other) const {
Expand Down
1 change: 1 addition & 0 deletions components/page_load_metrics/common/page_load_timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace page_load_metrics {
struct PageLoadTiming {
public:
PageLoadTiming();
PageLoadTiming(const PageLoadTiming& other);
~PageLoadTiming();

bool operator==(const PageLoadTiming& other) const;
Expand Down
2 changes: 2 additions & 0 deletions components/safe_browsing_db/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ bool IsKnownList(const std::string& name) {
ThreatMetadata::ThreatMetadata()
: threat_pattern_type(ThreatPatternType::NONE) {}

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

ThreatMetadata::~ThreatMetadata() {}

// SBCachedFullHashResult ------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions components/safe_browsing_db/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ enum class ThreatPatternType {
// Some fields are only applicable to certain lists.
struct ThreatMetadata {
ThreatMetadata();
ThreatMetadata(const ThreatMetadata& other);
~ThreatMetadata();

// Type of blacklisted page. Used on malware and UwS lists.
Expand Down
3 changes: 3 additions & 0 deletions content/browser/frame_host/frame_tree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ FrameTree::NodeRange::NodeRange(FrameTreeNode* root,
FrameTreeNode* node_to_skip)
: root_(root), node_to_skip_(node_to_skip) {}

FrameTree::ConstNodeIterator::ConstNodeIterator(
const ConstNodeIterator& other) = default;

FrameTree::ConstNodeIterator::~ConstNodeIterator() {}

FrameTree::ConstNodeIterator& FrameTree::ConstNodeIterator::operator++() {
Expand Down
1 change: 1 addition & 0 deletions content/browser/frame_host/frame_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class CONTENT_EXPORT FrameTree {

class CONTENT_EXPORT ConstNodeIterator {
public:
ConstNodeIterator(const ConstNodeIterator& other);
~ConstNodeIterator();

ConstNodeIterator& operator++();
Expand Down
3 changes: 3 additions & 0 deletions content/browser/gpu/gpu_process_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ GpuMainThreadFactoryFunction g_gpu_main_thread_factory = NULL;
GpuProcessHost::EstablishChannelRequest::EstablishChannelRequest()
: client_id(0) {}

GpuProcessHost::EstablishChannelRequest::EstablishChannelRequest(
const EstablishChannelRequest& other) = default;

GpuProcessHost::EstablishChannelRequest::~EstablishChannelRequest() {}

void GpuProcessHost::RegisterGpuMainThreadFactory(
Expand Down
1 change: 1 addition & 0 deletions content/browser/gpu/gpu_process_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,

struct EstablishChannelRequest {
EstablishChannelRequest();
EstablishChannelRequest(const EstablishChannelRequest& other);
~EstablishChannelRequest();
int32_t client_id;
EstablishChannelCallback callback;
Expand Down
3 changes: 3 additions & 0 deletions content/common/frame_replication_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ FrameReplicationState::FrameReplicationState(
has_potentially_trustworthy_unique_origin(
has_potentially_trustworthy_unique_origin) {}

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

FrameReplicationState::~FrameReplicationState() {
}

Expand Down
1 change: 1 addition & 0 deletions content/common/frame_replication_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct CONTENT_EXPORT FrameReplicationState {
blink::WebSandboxFlags sandbox_flags,
bool should_enforce_strict_mixed_content_checking,
bool has_potentially_trustworthy_unique_origin);
FrameReplicationState(const FrameReplicationState& other);
~FrameReplicationState();

// Current origin of the frame. This field is updated whenever a frame
Expand Down
6 changes: 5 additions & 1 deletion content/public/common/frame_navigate_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@

#include "content/common/content_export.h"
#include "content/public/common/referrer.h"
#include "ipc/ipc_message_utils.h"
#include "net/base/host_port_pair.h"
#include "ui/base/page_transition_types.h"
#include "url/gurl.h"

namespace content {

// Struct used by WebContentsObserver.
struct CONTENT_EXPORT FrameNavigateParams {
// Note that we derived from IPC::NoParams here, because this struct is used in
// an IPC struct as a parent. Deriving from NoParams allows us to by-pass the
// out of line constructor checks in our clang plugins.
struct CONTENT_EXPORT FrameNavigateParams : public IPC::NoParams {
FrameNavigateParams();
FrameNavigateParams(const FrameNavigateParams& other);
~FrameNavigateParams();
Expand Down
2 changes: 2 additions & 0 deletions gpu/command_buffer/service/gpu_preferences.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ namespace gpu {
GpuPreferences::GpuPreferences() {
}

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

GpuPreferences::~GpuPreferences() {}

} // namespace gpu
2 changes: 2 additions & 0 deletions gpu/command_buffer/service/gpu_preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ struct GPU_EXPORT GpuPreferences {
public:
GpuPreferences();

GpuPreferences(const GpuPreferences& other);

~GpuPreferences();

// ===================================
Expand Down
3 changes: 3 additions & 0 deletions gpu/ipc/common/memory_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ namespace gpu {
VideoMemoryUsageStats::VideoMemoryUsageStats()
: bytes_allocated(0), bytes_allocated_historical_max(0) {}

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

VideoMemoryUsageStats::~VideoMemoryUsageStats() {}

VideoMemoryUsageStats::ProcessStats::ProcessStats()
Expand Down
1 change: 1 addition & 0 deletions gpu/ipc/common/memory_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace gpu {
// is sent over IPC which could span 32 & 64 bit processes.
struct GPU_EXPORT VideoMemoryUsageStats {
VideoMemoryUsageStats();
VideoMemoryUsageStats(const VideoMemoryUsageStats& other);
~VideoMemoryUsageStats();

struct GPU_EXPORT ProcessStats {
Expand Down
2 changes: 2 additions & 0 deletions ipc/ipc_message_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ LogData::LogData()
dispatch(0) {
}

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

LogData::~LogData() {
}

Expand Down
1 change: 1 addition & 0 deletions ipc/ipc_message_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ struct ChannelHandle;
// How we send IPC message logs across channels.
struct IPC_EXPORT LogData {
LogData();
LogData(const LogData& other);
~LogData();

std::string channel;
Expand Down
3 changes: 3 additions & 0 deletions mojo/edk/system/request_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ RequestContext::WatchNotifyFinalizer::WatchNotifyFinalizer(
: watcher(watcher), result(result), state(state) {
}

RequestContext::WatchNotifyFinalizer::WatchNotifyFinalizer(
const WatchNotifyFinalizer& other) = default;

RequestContext::WatchNotifyFinalizer::~WatchNotifyFinalizer() {}

} // namespace edk
Expand Down
Loading

0 comments on commit bf0d713

Please sign in to comment.