Skip to content

Commit

Permalink
Added DISALLOW_COPY_AND_ASSIGN to disable copy/assign.
Browse files Browse the repository at this point in the history
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Copy_Constructors#Copy_Constructors

Sorry for missing this before while merging. jar pointed to the above
link on Friday and learned from him it is safer to add the above macro
whereever possible. Didn't touch .cc files (or *test.cc).

These changes are in internal CL: 65311983

Merge internal change: 65311983

R=rch@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265207 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
rtenneti@chromium.org committed Apr 22, 2014
1 parent c173e5a commit b99c0fc
Show file tree
Hide file tree
Showing 59 changed files with 172 additions and 2 deletions.
2 changes: 2 additions & 0 deletions net/quic/congestion_control/available_channel_estimator.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class NET_EXPORT_PRIVATE AvailableChannelEstimator {
QuicTime last_receive_time_;
int number_of_sequence_numbers_;
QuicByteCount received_bytes_;

DISALLOW_COPY_AND_ASSIGN(AvailableChannelEstimator);
};

} // namespace net
Expand Down
3 changes: 3 additions & 0 deletions net/quic/congestion_control/cube_root.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class NET_EXPORT_PRIVATE CubeRoot {
// Calculates the cube root using a table lookup followed by one Newton-
// Raphson iteration.
static uint32 Root(uint64 a);

private:
DISALLOW_COPY_AND_ASSIGN(CubeRoot);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/congestion_control/rtt_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class NET_EXPORT_PRIVATE RttStats {
// larger than the standard deviation, for a normally distributed signal.
QuicTime::Delta mean_deviation_;
int64 initial_rtt_us_;

DISALLOW_COPY_AND_ASSIGN(RttStats);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/congestion_control/tcp_loss_algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class NET_EXPORT_PRIVATE TCPLossAlgorithm : public LossDetectionInterface {

private:
QuicTime loss_detection_timeout_;

DISALLOW_COPY_AND_ASSIGN(TCPLossAlgorithm);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/congestion_control/time_loss_algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class NET_EXPORT_PRIVATE TimeLossAlgorithm : public LossDetectionInterface {

private:
QuicTime loss_detection_timeout_;

DISALLOW_COPY_AND_ASSIGN(TimeLossAlgorithm);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/crypto/aead_base_decrypter.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ class NET_EXPORT_PRIVATE AeadBaseDecrypter : public QuicDecrypter {
#if defined(USE_OPENSSL)
ScopedEVPAEADCtx ctx_;
#endif

DISALLOW_COPY_AND_ASSIGN(AeadBaseDecrypter);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/crypto/aead_base_encrypter.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ class NET_EXPORT_PRIVATE AeadBaseEncrypter : public QuicEncrypter {
#if defined(USE_OPENSSL)
ScopedEVPAEADCtx ctx_;
#endif

DISALLOW_COPY_AND_ASSIGN(AeadBaseEncrypter);
};

} // namespace net
Expand Down
3 changes: 3 additions & 0 deletions net/quic/crypto/aes_128_gcm_12_decrypter.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class NET_EXPORT_PRIVATE Aes128Gcm12Decrypter : public AeadBaseDecrypter {
size_t auth_tag_size,
AeadParams* aead_params) const OVERRIDE;
#endif

private:
DISALLOW_COPY_AND_ASSIGN(Aes128Gcm12Decrypter);
};

} // namespace net
Expand Down
3 changes: 3 additions & 0 deletions net/quic/crypto/aes_128_gcm_12_encrypter.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class NET_EXPORT_PRIVATE Aes128Gcm12Encrypter : public AeadBaseEncrypter {
size_t auth_tag_size,
AeadParams* aead_params) const OVERRIDE;
#endif

private:
DISALLOW_COPY_AND_ASSIGN(Aes128Gcm12Encrypter);
};

} // namespace net
Expand Down
3 changes: 3 additions & 0 deletions net/quic/crypto/cert_compressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ class NET_EXPORT_PRIVATE CertCompressor {
const std::vector<std::string>& cached_certs,
const CommonCertSets* common_sets,
std::vector<std::string>* out_certs);

private:
DISALLOW_COPY_AND_ASSIGN(CertCompressor);
};

} // namespace net
Expand Down
3 changes: 3 additions & 0 deletions net/quic/crypto/chacha20_poly1305_decrypter.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class NET_EXPORT_PRIVATE ChaCha20Poly1305Decrypter : public AeadBaseDecrypter {
size_t auth_tag_size,
AeadParams* aead_params) const OVERRIDE;
#endif

private:
DISALLOW_COPY_AND_ASSIGN(ChaCha20Poly1305Decrypter);
};

} // namespace net
Expand Down
3 changes: 3 additions & 0 deletions net/quic/crypto/chacha20_poly1305_encrypter.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class NET_EXPORT_PRIVATE ChaCha20Poly1305Encrypter : public AeadBaseEncrypter {
size_t auth_tag_size,
AeadParams* aead_params) const OVERRIDE;
#endif

private:
DISALLOW_COPY_AND_ASSIGN(ChaCha20Poly1305Encrypter);
};

} // namespace net
Expand Down
3 changes: 3 additions & 0 deletions net/quic/crypto/channel_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class NET_EXPORT_PRIVATE ChannelIDVerifier {
base::StringPiece signed_data,
base::StringPiece signature,
bool is_channel_id_signature);

private:
DISALLOW_COPY_AND_ASSIGN(ChannelIDVerifier);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/crypto/crypto_server_config_protobuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ class NET_EXPORT_PRIVATE QuicServerConfigProtobuf {
// primary time. For use as a secondary sort key when selecting the
// primary config.
uint64 priority_;

DISALLOW_COPY_AND_ASSIGN(QuicServerConfigProtobuf);
};

} // namespace net
Expand Down
3 changes: 3 additions & 0 deletions net/quic/crypto/crypto_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ class NET_EXPORT_PRIVATE CryptoUtils {
const std::string& hkdf_input,
Perspective perspective,
CrypterPair* out);

private:
DISALLOW_COPY_AND_ASSIGN(CryptoUtils);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/crypto/null_decrypter.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class NET_EXPORT_PRIVATE NullDecrypter : public QuicDecrypter {
private:
bool ReadHash(QuicDataReader* reader, uint128* hash);
uint128 ComputeHash(const std::string& data) const;

DISALLOW_COPY_AND_ASSIGN(NullDecrypter);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/crypto/null_encrypter.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class NET_EXPORT_PRIVATE NullEncrypter : public QuicEncrypter {

private:
size_t GetHashLength() const;

DISALLOW_COPY_AND_ASSIGN(NullEncrypter);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/crypto/p256_key_exchange.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ class NET_EXPORT_PRIVATE P256KeyExchange : public KeyExchange {
#endif
// The public key stored as an uncompressed P-256 point.
uint8 public_key_[kUncompressedP256PointBytes];

DISALLOW_COPY_AND_ASSIGN(P256KeyExchange);
};

} // namespace net
Expand Down
5 changes: 5 additions & 0 deletions net/quic/crypto/quic_crypto_server_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class PrimaryConfigChangedCallback {
PrimaryConfigChangedCallback();
virtual ~PrimaryConfigChangedCallback();
virtual void Run(const std::string& scid) = 0;

private:
DISALLOW_COPY_AND_ASSIGN(PrimaryConfigChangedCallback);
};

// Callback used to accept the result of the |client_hello| validation step.
Expand Down Expand Up @@ -446,6 +449,8 @@ class NET_EXPORT_PRIVATE QuicCryptoServerConfig {
uint32 source_address_token_lifetime_secs_;
uint32 server_nonce_strike_register_max_entries_;
uint32 server_nonce_strike_register_window_secs_;

DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerConfig);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/crypto/quic_server_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ class NET_EXPORT_PRIVATE QuicServerInfo {
// This is the QUIC server (hostname, port, is_https, privacy_mode) tuple for
// which we restore the crypto_config.
const QuicServerId server_id_;

DISALLOW_COPY_AND_ASSIGN(QuicServerInfo);
};

class QuicServerInfoFactory {
Expand Down
4 changes: 4 additions & 0 deletions net/quic/crypto/scoped_evp_aead_ctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include <openssl/evp.h>

#include "base/basictypes.h"

namespace net {

// ScopedEVPAEADCtx manages an EVP_AEAD_CTX object and calls the needed cleanup
Expand All @@ -20,6 +22,8 @@ class ScopedEVPAEADCtx {

private:
EVP_AEAD_CTX ctx_;

DISALLOW_COPY_AND_ASSIGN(ScopedEVPAEADCtx);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/crypto/source_address_token.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class SourceAddressToken {
private:
std::string ip_;
int64 timestamp_;

DISALLOW_COPY_AND_ASSIGN(SourceAddressToken);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/crypto/strike_register.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ class NET_EXPORT_PRIVATE StrikeRegister {
// this header.
InternalNode* internal_nodes_;
scoped_ptr<uint8[]> external_nodes_;

DISALLOW_COPY_AND_ASSIGN(StrikeRegister);
};

} // namespace net
Expand Down
1 change: 0 additions & 1 deletion net/quic/iovector.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ inline size_t TotalIovecLength(const struct iovec* iov, size_t iovcnt) {
// to avoid accidentally change an entry that is assembled by two or more
// Append()'s by simply an index access.
//

class NET_EXPORT_PRIVATE IOVector {
public:
// Provide a default constructor so it'll never be inhibited by adding other
Expand Down
2 changes: 2 additions & 0 deletions net/quic/quic_ack_notifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ class NET_EXPORT_PRIVATE QuicAckNotifier {
int retransmitted_packet_count_;
// Number of bytes that had to be retransmitted.
int retransmitted_byte_count_;

DISALLOW_COPY_AND_ASSIGN(QuicAckNotifier);
};

}; // namespace net
Expand Down
3 changes: 2 additions & 1 deletion net/quic/quic_ack_notifier_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class QuicAckNotifier;
// a set of AckNotifiers and a map from sequence number to AckNotifier the sake
// of efficiency - we can quickly check the map to see if any AckNotifiers are
// interested in a given sequence number.

class NET_EXPORT_PRIVATE AckNotifierManager {
public:
AckNotifierManager();
Expand Down Expand Up @@ -72,6 +71,8 @@ class NET_EXPORT_PRIVATE AckNotifierManager {
// number, call OnAck for all mapped AckNotifiers.
// Does not own the AckNotifiers.
AckNotifierMap ack_notifier_map_;

DISALLOW_COPY_AND_ASSIGN(AckNotifierManager);
};

} // namespace net
Expand Down
3 changes: 3 additions & 0 deletions net/quic/quic_clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class NET_EXPORT_PRIVATE QuicClock {
// WallNow returns the current wall-time - a time that is consistent across
// different clocks.
virtual QuicWallTime WallNow() const;

private:
DISALLOW_COPY_AND_ASSIGN(QuicClock);
};

} // namespace net
Expand Down
1 change: 1 addition & 0 deletions net/quic/quic_connection_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class NET_EXPORT_PRIVATE QuicConnectionLogger
// The available type of connection (WiFi, 3G, etc.) when connection was first
// used.
const char* const connection_description_;

DISALLOW_COPY_AND_ASSIGN(QuicConnectionLogger);
};

Expand Down
2 changes: 2 additions & 0 deletions net/quic/quic_crypto_server_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ class NET_EXPORT_PRIVATE QuicCryptoServerStream : public QuicCryptoStream {
// FinishProcessingHandshakeMessage for processing. NULL if no
// handshake message is being validated.
ValidateCallback* validate_client_hello_cb_;

DISALLOW_COPY_AND_ASSIGN(QuicCryptoServerStream);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/quic_data_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ class NET_EXPORT_PRIVATE QuicDataReader {

// The location of the next read from our data buffer.
size_t pos_;

DISALLOW_COPY_AND_ASSIGN(QuicDataReader);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/quic_data_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ class NET_EXPORT_PRIVATE QuicDataWriter {
char* buffer_;
size_t capacity_; // Allocation size of payload (or -1 if buffer is const).
size_t length_; // Current length of the buffer.

DISALLOW_COPY_AND_ASSIGN(QuicDataWriter);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/quic_default_packet_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class NET_EXPORT_PRIVATE QuicDefaultPacketWriter : public QuicPacketWriter {
DatagramClientSocket* socket_;
QuicConnection* connection_;
bool write_blocked_;

DISALLOW_COPY_AND_ASSIGN(QuicDefaultPacketWriter);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/quic_http_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ class NET_EXPORT_PRIVATE QuicHttpStream :
BoundNetLog stream_net_log_;

base::WeakPtrFactory<QuicHttpStream> weak_factory_;

DISALLOW_COPY_AND_ASSIGN(QuicHttpStream);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/quic_received_packet_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class NET_EXPORT_PRIVATE QuicReceivedPacketManager :
scoped_ptr<ReceiveAlgorithmInterface> receive_algorithm_;

QuicConnectionStats* stats_;

DISALLOW_COPY_AND_ASSIGN(QuicReceivedPacketManager);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/quic_sent_entropy_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class NET_EXPORT_PRIVATE QuicSentEntropyManager {

// Cumulative hash of entropy of all sent packets.
QuicPacketEntropyHash packets_entropy_hash_;

DISALLOW_COPY_AND_ASSIGN(QuicSentEntropyManager);
};

} // namespace net
Expand Down
1 change: 1 addition & 0 deletions net/quic/quic_socket_address_coder.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class NET_EXPORT_PRIVATE QuicSocketAddressCoder {

private:
IPEndPoint address_;

DISALLOW_COPY_AND_ASSIGN(QuicSocketAddressCoder);
};

Expand Down
2 changes: 2 additions & 0 deletions net/quic/quic_stream_sequencer.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ class NET_EXPORT_PRIVATE QuicStreamSequencer {

// Count of the number of duplicate frames received.
int num_duplicate_frames_received_;

DISALLOW_COPY_AND_ASSIGN(QuicStreamSequencer);
};

} // namespace net
Expand Down
3 changes: 3 additions & 0 deletions net/quic/quic_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ class NET_EXPORT_PRIVATE QuicUtils {
static QuicPriority LowestPriority();

static QuicPriority HighestPriority();

private:
DISALLOW_COPY_AND_ASSIGN(QuicUtils);
};

// Utility function that returns an IOVector object wrapped around |str|.
Expand Down
3 changes: 3 additions & 0 deletions net/quic/spdy_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class NET_EXPORT_PRIVATE SpdyUtils {
public:
static std::string SerializeUncompressedHeaders(
const SpdyHeaderBlock& headers);

private:
DISALLOW_COPY_AND_ASSIGN(SpdyUtils);
};

} // namespace net
Expand Down
2 changes: 2 additions & 0 deletions net/quic/test_tools/crypto_test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ class CryptoTestUtils {
private:
static void CompareClientAndServerKeys(QuicCryptoClientStream* client,
QuicCryptoServerStream* server);

DISALLOW_COPY_AND_ASSIGN(CryptoTestUtils);
};

} // namespace test
Expand Down
Loading

0 comments on commit b99c0fc

Please sign in to comment.