Skip to content

Commit 07ad3aa

Browse files
committed
Remove the base/macros.h file and fix its users.
We live in a C++11 world, and haven't needed the indirection for a good while.
1 parent 4e16964 commit 07ad3aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+169
-250
lines changed

cpp/base/macros.h

Lines changed: 0 additions & 12 deletions
This file was deleted.

cpp/base/notification.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
#include <condition_variable>
66
#include <mutex>
77

8-
#include "base/macros.h"
9-
108
namespace cert_trans {
119

1210

1311
class Notification {
1412
public:
1513
Notification() : notified_(false) {
1614
}
15+
Notification(const Notification&) = delete;
16+
Notification& operator=(const Notification&) = delete;
1717

1818
void Notify();
1919

@@ -30,8 +30,6 @@ class Notification {
3030
mutable std::mutex lock_;
3131
mutable std::condition_variable cv_;
3232
bool notified_;
33-
34-
DISALLOW_COPY_AND_ASSIGN(Notification);
3533
};
3634

3735

cpp/client/async_log_client.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <utility>
99
#include <vector>
1010

11-
#include "base/macros.h"
1211
#include "net/url_fetcher.h"
1312
#include "proto/ct.pb.h"
1413

@@ -53,6 +52,8 @@ class AsyncLogClient {
5352
// instead of a string?
5453
AsyncLogClient(util::Executor* const executor, UrlFetcher* fetcher,
5554
const std::string& server_uri);
55+
AsyncLogClient(const AsyncLogClient&) = delete;
56+
AsyncLogClient& operator=(const AsyncLogClient&) = delete;
5657

5758
void GetSTH(ct::SignedTreeHead* sth, const Callback& done);
5859

@@ -102,8 +103,6 @@ class AsyncLogClient {
102103
util::Executor* const executor_;
103104
UrlFetcher* const fetcher_;
104105
const URL server_url_;
105-
106-
DISALLOW_COPY_AND_ASSIGN(AsyncLogClient);
107106
};
108107

109108

cpp/client/client.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
#include <stdint.h>
55
#include <string>
66

7-
#include "base/macros.h"
8-
97
// Socket creation for client connections.
108
class Client {
119
public:
1210
Client(const std::string& server, const std::string& port);
1311

1412
~Client();
13+
Client(const Client&) = delete;
14+
Client& operator=(const Client&) = delete;
1515

1616
// Create a TCP socket and attempt to connect to server:port.
1717
// The Connect()-Disconnect() sequence can be called repeatedly.
@@ -36,8 +36,6 @@ class Client {
3636
const std::string server_;
3737
const std::string port_;
3838
int fd_;
39-
40-
DISALLOW_COPY_AND_ASSIGN(Client);
4139
};
4240

4341
#endif // CERT_TRANS_CLIENT_CLIENT_H_

cpp/client/http_log_client.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <memory>
66
#include <string>
77

8-
#include "base/macros.h"
98
#include "client/async_log_client.h"
109
#include "proto/ct.pb.h"
1110
#include "util/libevent_wrapper.h"
@@ -20,6 +19,8 @@ class Cert;
2019
class HTTPLogClient {
2120
public:
2221
explicit HTTPLogClient(const std::string& server);
22+
HTTPLogClient(const HTTPLogClient&) = delete;
23+
HTTPLogClient& operator=(const HTTPLogClient&) = delete;
2324

2425
util::StatusOr<ct::SignedCertificateTimestamp> UploadSubmission(
2526
const std::string& submission, bool pre);
@@ -42,8 +43,6 @@ class HTTPLogClient {
4243
ThreadPool pool_;
4344
UrlFetcher fetcher_;
4445
AsyncLogClient client_;
45-
46-
DISALLOW_COPY_AND_ASSIGN(HTTPLogClient);
4746
};
4847

4948

cpp/client/ssl_client.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include <openssl/ssl.h>
55
#include <openssl/x509.h>
66

7-
#include "base/macros.h"
87
#include "client/client.h"
98
#include "client/ssl_client.h"
109
#include "log/log_verifier.h"
@@ -25,6 +24,8 @@ class SSLClient {
2524
const std::string& ca_dir, LogVerifier* verifier);
2625

2726
~SSLClient();
27+
SSLClient(const SSLClient&) = delete;
28+
SSLClient& operator=(const SSLClient&) = delete;
2829

2930
enum HandshakeResult {
3031
OK = 0,
@@ -103,8 +104,6 @@ class SSLClient {
103104
void ResetVerifyCallbackArgs(bool strict);
104105

105106
HandshakeResult SSLConnect(bool strict);
106-
107-
DISALLOW_COPY_AND_ASSIGN(SSLClient);
108107
};
109108

110109

cpp/fetcher/continuous_fetcher.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ class ContinuousFetcherImpl : public ContinuousFetcher {
3232
public:
3333
ContinuousFetcherImpl(libevent::Base* base, Executor* executor, Database* db,
3434
const LogVerifier* log_verifier, bool fetch_scts);
35+
ContinuousFetcherImpl(const ContinuousFetcherImpl&) = delete;
36+
ContinuousFetcherImpl& operator=(const ContinuousFetcherImpl&) = delete;
3537

3638
void AddPeer(const string& node_id, const shared_ptr<Peer>& peer) override;
3739
void RemovePeer(const string& node_id) override;
@@ -52,8 +54,6 @@ class ContinuousFetcherImpl : public ContinuousFetcher {
5254

5355
bool restart_fetch_;
5456
unique_ptr<Task> fetch_task_;
55-
56-
DISALLOW_COPY_AND_ASSIGN(ContinuousFetcherImpl);
5757
};
5858

5959

cpp/fetcher/continuous_fetcher.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <set>
88
#include <string>
99

10-
#include "base/macros.h"
1110
#include "fetcher/peer.h"
1211
#include "log/database.h"
1312
#include "log/logged_entry.h"
@@ -27,6 +26,8 @@ class ContinuousFetcher {
2726
const LogVerifier* log_verifier, bool fetch_scts);
2827

2928
virtual ~ContinuousFetcher() = default;
29+
ContinuousFetcher(const ContinuousFetcher&) = delete;
30+
ContinuousFetcher& operator=(const ContinuousFetcher&) = delete;
3031

3132
virtual void AddPeer(const std::string& node_id,
3233
const std::shared_ptr<Peer>& peer) = 0;
@@ -35,9 +36,6 @@ class ContinuousFetcher {
3536

3637
protected:
3738
ContinuousFetcher() = default;
38-
39-
private:
40-
DISALLOW_COPY_AND_ASSIGN(ContinuousFetcher);
4139
};
4240

4341

cpp/fetcher/fetcher.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <memory>
66
#include <mutex>
77

8-
#include "base/macros.h"
98
#include "log/log_verifier.h"
109
#include "monitoring/monitoring.h"
1110

@@ -64,6 +63,8 @@ struct Range {
6463
struct FetchState {
6564
FetchState(Database* db, unique_ptr<PeerGroup> peer_group,
6665
const LogVerifier* log_verifier, Task* task);
66+
FetchState(const FetchState&) = delete;
67+
FetchState& operator=(const FetchState&) = delete;
6768

6869
void WalkEntries();
6970
void FetchRange(const unique_lock<mutex>& lock, Range* current,
@@ -80,9 +81,6 @@ struct FetchState {
8081
mutex lock_;
8182
int64_t start_;
8283
unique_ptr<Range> entries_;
83-
84-
private:
85-
DISALLOW_COPY_AND_ASSIGN(FetchState);
8684
};
8785

8886

cpp/fetcher/peer.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#include <memory>
55

6-
#include "base/macros.h"
76
#include "client/async_log_client.h"
87

98
namespace cert_trans {
@@ -12,8 +11,9 @@ namespace cert_trans {
1211
class Peer {
1312
public:
1413
Peer(std::unique_ptr<AsyncLogClient> client);
15-
virtual ~Peer() {
16-
}
14+
virtual ~Peer() = default;
15+
Peer(const Peer&) = delete;
16+
Peer& operator=(const Peer&) = delete;
1717

1818
AsyncLogClient& client() {
1919
return *client_;
@@ -24,9 +24,6 @@ class Peer {
2424

2525
protected:
2626
const std::unique_ptr<AsyncLogClient> client_;
27-
28-
private:
29-
DISALLOW_COPY_AND_ASSIGN(Peer);
3027
};
3128

3229

0 commit comments

Comments
 (0)