Commit 3e9ca563 authored by xhwang's avatar xhwang Committed by Commit bot

Deprecate *_EXPORT_PRIVATE macros.

Replaced all *_EXPORT_PRIVATE macros with *_EXPORT except for /net, /sync and
/storage.

BUG=552248
TEST=No functionality change.

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

Cr-Commit-Position: refs/heads/master@{#358362}
parent 325596d6
......@@ -10,25 +10,20 @@
#if defined(BASE_IMPLEMENTATION)
#define BASE_EXPORT __declspec(dllexport)
#define BASE_EXPORT_PRIVATE __declspec(dllexport)
#else
#define BASE_EXPORT __declspec(dllimport)
#define BASE_EXPORT_PRIVATE __declspec(dllimport)
#endif // defined(BASE_IMPLEMENTATION)
#else // defined(WIN32)
#if defined(BASE_IMPLEMENTATION)
#define BASE_EXPORT __attribute__((visibility("default")))
#define BASE_EXPORT_PRIVATE __attribute__((visibility("default")))
#else
#define BASE_EXPORT
#define BASE_EXPORT_PRIVATE
#endif // defined(BASE_IMPLEMENTATION)
#endif
#else // defined(COMPONENT_BUILD)
#define BASE_EXPORT
#define BASE_EXPORT_PRIVATE
#endif
#endif // BASE_BASE_EXPORT_H_
......@@ -40,7 +40,7 @@ class JSONParserTest;
// of a token, such that the next iteration of the parser will be at the byte
// immediately following the token, which would likely be the first byte of the
// next token.
class BASE_EXPORT_PRIVATE JSONParser {
class BASE_EXPORT JSONParser {
public:
explicit JSONParser(int options);
~JSONParser();
......
......@@ -71,7 +71,7 @@ class BASE_EXPORT BucketRanges {
//////////////////////////////////////////////////////////////////////////////
// Expose only for test.
BASE_EXPORT_PRIVATE extern const uint32 kCrcTable[256];
BASE_EXPORT extern const uint32 kCrcTable[256];
} // namespace base
......
......@@ -224,7 +224,7 @@ class BASE_EXPORT Histogram : public HistogramBase {
friend class StatisticsRecorder; // To allow it to delete duplicates.
friend class StatisticsRecorderTest;
friend BASE_EXPORT_PRIVATE HistogramBase* DeserializeHistogramInfo(
friend BASE_EXPORT HistogramBase* DeserializeHistogramInfo(
base::PickleIterator* iter);
static HistogramBase* DeserializeInfoImpl(base::PickleIterator* iter);
......@@ -349,7 +349,7 @@ class BASE_EXPORT LinearHistogram : public Histogram {
bool PrintEmptyBucket(size_t index) const override;
private:
friend BASE_EXPORT_PRIVATE HistogramBase* DeserializeHistogramInfo(
friend BASE_EXPORT HistogramBase* DeserializeHistogramInfo(
base::PickleIterator* iter);
static HistogramBase* DeserializeInfoImpl(base::PickleIterator* iter);
......@@ -379,7 +379,7 @@ class BASE_EXPORT BooleanHistogram : public LinearHistogram {
private:
BooleanHistogram(const std::string& name, const BucketRanges* ranges);
friend BASE_EXPORT_PRIVATE HistogramBase* DeserializeHistogramInfo(
friend BASE_EXPORT HistogramBase* DeserializeHistogramInfo(
base::PickleIterator* iter);
static HistogramBase* DeserializeInfoImpl(base::PickleIterator* iter);
......@@ -427,7 +427,7 @@ class BASE_EXPORT CustomHistogram : public Histogram {
double GetBucketSize(Count current, size_t i) const override;
private:
friend BASE_EXPORT_PRIVATE HistogramBase* DeserializeHistogramInfo(
friend BASE_EXPORT HistogramBase* DeserializeHistogramInfo(
base::PickleIterator* iter);
static HistogramBase* DeserializeInfoImpl(base::PickleIterator* iter);
......
......@@ -43,8 +43,7 @@ std::string HistogramTypeToString(HistogramType type);
// Create or find existing histogram that matches the pickled info.
// Returns NULL if the pickled data has problems.
BASE_EXPORT_PRIVATE HistogramBase* DeserializeHistogramInfo(
base::PickleIterator* iter);
BASE_EXPORT HistogramBase* DeserializeHistogramInfo(base::PickleIterator* iter);
////////////////////////////////////////////////////////////////////////////////
......
......@@ -17,7 +17,7 @@
namespace base {
class BASE_EXPORT_PRIVATE SampleMap : public HistogramSamples {
class BASE_EXPORT SampleMap : public HistogramSamples {
public:
SampleMap();
~SampleMap() override;
......@@ -40,7 +40,7 @@ class BASE_EXPORT_PRIVATE SampleMap : public HistogramSamples {
DISALLOW_COPY_AND_ASSIGN(SampleMap);
};
class BASE_EXPORT_PRIVATE SampleMapIterator : public SampleCountIterator {
class BASE_EXPORT SampleMapIterator : public SampleCountIterator {
public:
typedef std::map<HistogramBase::Sample, HistogramBase::Count>
SampleToCountMap;
......
......@@ -20,7 +20,7 @@ namespace base {
class BucketRanges;
class BASE_EXPORT_PRIVATE SampleVector : public HistogramSamples {
class BASE_EXPORT SampleVector : public HistogramSamples {
public:
explicit SampleVector(const BucketRanges* bucket_ranges);
~SampleVector() override;
......@@ -53,7 +53,7 @@ class BASE_EXPORT_PRIVATE SampleVector : public HistogramSamples {
DISALLOW_COPY_AND_ASSIGN(SampleVector);
};
class BASE_EXPORT_PRIVATE SampleVectorIterator : public SampleCountIterator {
class BASE_EXPORT SampleVectorIterator : public SampleCountIterator {
public:
SampleVectorIterator(const std::vector<HistogramBase::AtomicCount>* counts,
const BucketRanges* bucket_ranges);
......
......@@ -28,7 +28,7 @@ namespace base {
class HistogramSamples;
class BASE_EXPORT_PRIVATE SparseHistogram : public HistogramBase {
class BASE_EXPORT SparseHistogram : public HistogramBase {
public:
// If there's one with same name, return the existing one. If not, create a
// new one.
......@@ -57,7 +57,7 @@ class BASE_EXPORT_PRIVATE SparseHistogram : public HistogramBase {
// Clients should always use FactoryGet to create SparseHistogram.
explicit SparseHistogram(const std::string& name);
friend BASE_EXPORT_PRIVATE HistogramBase* DeserializeHistogramInfo(
friend BASE_EXPORT HistogramBase* DeserializeHistogramInfo(
base::PickleIterator* iter);
static HistogramBase* DeserializeInfoImpl(base::PickleIterator* iter);
......
......@@ -46,7 +46,7 @@ struct GCMNetworkChannelDiagnostic {
// GCMNetworkChannel is an implementation of SyncNetworkChannel that routes
// messages through GCMService.
class INVALIDATION_EXPORT_PRIVATE GCMNetworkChannel
class INVALIDATION_EXPORT GCMNetworkChannel
: public SyncNetworkChannel,
public net::URLFetcherDelegate,
public net::NetworkChangeNotifier::NetworkChangeObserver,
......
......@@ -34,7 +34,7 @@ class PushClient;
namespace syncer {
// This class must live on the IO thread.
class INVALIDATION_EXPORT_PRIVATE InvalidationNotifier
class INVALIDATION_EXPORT InvalidationNotifier
: public Invalidator,
public SyncInvalidationListener::Delegate,
public base::NonThreadSafe {
......
......@@ -36,7 +36,7 @@ class GCMNetworkChannelDelegate;
typedef base::Callback<scoped_ptr<SyncNetworkChannel>(void)>
NetworkChannelCreator;
class INVALIDATION_EXPORT_PRIVATE NonBlockingInvalidator
class INVALIDATION_EXPORT NonBlockingInvalidator
: public Invalidator,
public InvalidationStateTracker {
public:
......
......@@ -43,16 +43,16 @@ enum P2PNotificationTarget {
LAST_NOTIFICATION_TARGET = NOTIFY_ALL
};
INVALIDATION_EXPORT_PRIVATE std::string P2PNotificationTargetToString(
INVALIDATION_EXPORT std::string P2PNotificationTargetToString(
P2PNotificationTarget target);
// If |target_str| can't be parsed, assumes NOTIFY_SELF.
INVALIDATION_EXPORT_PRIVATE P2PNotificationTarget
INVALIDATION_EXPORT P2PNotificationTarget
P2PNotificationTargetFromString(const std::string& target_str);
// Helper notification data class that can be serialized to and
// deserialized from a string.
class INVALIDATION_EXPORT_PRIVATE P2PNotificationData {
class INVALIDATION_EXPORT P2PNotificationData {
public:
// Initializes with an empty sender ID, target set to NOTIFY_SELF,
// and empty changed types.
......@@ -85,7 +85,7 @@ class INVALIDATION_EXPORT_PRIVATE P2PNotificationData {
ObjectIdInvalidationMap invalidation_map_;
};
class INVALIDATION_EXPORT_PRIVATE P2PInvalidator
class INVALIDATION_EXPORT P2PInvalidator
: public Invalidator,
public NON_EXPORTED_BASE(notifier::PushClientObserver) {
public:
......
......@@ -22,7 +22,7 @@ namespace syncer {
// A PushClientChannel is an implementation of NetworkChannel that
// routes messages through a PushClient.
class INVALIDATION_EXPORT_PRIVATE PushClientChannel
class INVALIDATION_EXPORT PushClientChannel
: public SyncNetworkChannel,
public NON_EXPORTED_BASE(notifier::PushClientObserver) {
public:
......
......@@ -32,8 +32,7 @@ using ::invalidation::InvalidationListener;
// implementations include the syncer thread (both versions) and XMPP
// retries. The most sophisticated one is URLRequestThrottler; making
// that generic should work for everyone.
class INVALIDATION_EXPORT_PRIVATE RegistrationManager
: public base::NonThreadSafe {
class INVALIDATION_EXPORT RegistrationManager : public base::NonThreadSafe {
public:
// Constants for exponential backoff (used by tests).
static const int kInitialRegistrationDelaySeconds;
......
......@@ -13,7 +13,7 @@
namespace syncer {
class INVALIDATION_EXPORT_PRIVATE StateWriter {
class INVALIDATION_EXPORT StateWriter {
public:
virtual ~StateWriter() {}
......
......@@ -40,7 +40,7 @@ class RegistrationManager;
// SyncInvalidationListener is not thread-safe and lives on the sync
// thread.
class INVALIDATION_EXPORT_PRIVATE SyncInvalidationListener
class INVALIDATION_EXPORT SyncInvalidationListener
: public NON_EXPORTED_BASE(invalidation::InvalidationListener),
public StateWriter,
public SyncNetworkChannel::Observer,
......@@ -54,7 +54,7 @@ class INVALIDATION_EXPORT_PRIVATE SyncInvalidationListener
const invalidation::string&,
invalidation::InvalidationListener*)> CreateInvalidationClientCallback;
class INVALIDATION_EXPORT_PRIVATE Delegate {
class INVALIDATION_EXPORT Delegate {
public:
virtual ~Delegate();
......
......@@ -85,7 +85,7 @@ class SyncInvalidationScheduler : public invalidation::Scheduler {
// - notifying observers about network channel state change
// Implementation of particular network protocol should implement
// SendMessage and call NotifyStateChange and DeliverIncomingMessage.
class INVALIDATION_EXPORT_PRIVATE SyncNetworkChannel
class INVALIDATION_EXPORT SyncNetworkChannel
: public NON_EXPORTED_BASE(invalidation::NetworkChannel) {
public:
class Observer {
......@@ -213,7 +213,7 @@ class SyncStorage : public invalidation::Storage {
std::string cached_state_;
};
class INVALIDATION_EXPORT_PRIVATE SyncSystemResources
class INVALIDATION_EXPORT SyncSystemResources
: public NON_EXPORTED_BASE(invalidation::SystemResources) {
public:
SyncSystemResources(SyncNetworkChannel* sync_network_channel,
......
......@@ -16,6 +16,5 @@
// For now, we provide dummy definitions of these tags.
#define INVALIDATION_EXPORT
#define INVALIDATION_EXPORT_PRIVATE
#endif // COMPONENTS_INVALIDATION_PUBLIC_INVALIDATION_EXPORT_H_
......@@ -17,7 +17,7 @@ namespace sessions {
// Provides an implementation of SerializedNavigationDriver that is backed by
// content classes.
class SESSIONS_EXPORT_PRIVATE ContentSerializedNavigationDriver
class SESSIONS_EXPORT ContentSerializedNavigationDriver
: public SerializedNavigationDriver {
public:
~ContentSerializedNavigationDriver() override;
......
......@@ -16,7 +16,7 @@ class SerializedNavigationEntry;
// The SerializedNavigationDriver interface allows SerializedNavigationEntry to
// obtain information from a singleton driver object. A concrete implementation
// must be provided by the driver on each platform.
class SESSIONS_EXPORT_PRIVATE SerializedNavigationDriver {
class SESSIONS_EXPORT SerializedNavigationDriver {
public:
virtual ~SerializedNavigationDriver() {}
......
......@@ -10,25 +10,20 @@
#if defined(SESSIONS_IMPLEMENTATION)
#define SESSIONS_EXPORT __declspec(dllexport)
#define SESSIONS_EXPORT_PRIVATE __declspec(dllexport)
#else
#define SESSIONS_EXPORT __declspec(dllimport)
#define SESSIONS_EXPORT_PRIVATE __declspec(dllimport)
#endif // defined(SESSIONS_IMPLEMENTATION)
#else // defined(WIN32)
#if defined(SESSIONS_IMPLEMENTATION)
#define SESSIONS_EXPORT __attribute__((visibility("default")))
#define SESSIONS_EXPORT_PRIVATE __attribute__((visibility("default")))
#else
#define SESSIONS_EXPORT
#define SESSIONS_EXPORT_PRIVATE
#endif
#endif
#else // defined(COMPONENT_BUILD)
#define SESSIONS_EXPORT
#define SESSIONS_EXPORT_PRIVATE
#endif
#endif // COMPONENTS_SESSIONS_CORE_SESSIONS_EXPORT_H_
......@@ -6,33 +6,27 @@
#define CRYPTO_CRYPTO_EXPORT_H_
// Defines CRYPTO_EXPORT so that functionality implemented by the crypto module
// can be exported to consumers, and CRYPTO_EXPORT_PRIVATE that allows unit
// tests to access features not intended to be used directly by real consumers.
// can be exported to consumers.
#if defined(COMPONENT_BUILD)
#if defined(WIN32)
#if defined(CRYPTO_IMPLEMENTATION)
#define CRYPTO_EXPORT __declspec(dllexport)
#define CRYPTO_EXPORT_PRIVATE __declspec(dllexport)
#else
#define CRYPTO_EXPORT __declspec(dllimport)
#define CRYPTO_EXPORT_PRIVATE __declspec(dllimport)
#endif // defined(CRYPTO_IMPLEMENTATION)
#else // defined(WIN32)
#if defined(CRYPTO_IMPLEMENTATION)
#define CRYPTO_EXPORT __attribute__((visibility("default")))
#define CRYPTO_EXPORT_PRIVATE __attribute__((visibility("default")))
#else
#define CRYPTO_EXPORT
#define CRYPTO_EXPORT_PRIVATE
#endif
#endif
#else // defined(COMPONENT_BUILD)
#define CRYPTO_EXPORT
#define CRYPTO_EXPORT_PRIVATE
#endif
#endif // CRYPTO_CRYPTO_EXPORT_H_
......@@ -25,7 +25,7 @@ namespace crypto {
//
// WARNING: this code is not constant time. However, in all likelihood, nor is
// the implementation of AES that is used.
class CRYPTO_EXPORT_PRIVATE GaloisHash {
class CRYPTO_EXPORT GaloisHash {
public:
explicit GaloisHash(const uint8 key[16]);
......
......@@ -24,9 +24,8 @@ namespace crypto {
// Opens an NSS software database in folder |path|, with the (potentially)
// user-visible description |description|. Returns the slot for the opened
// database, or NULL if the database could not be opened.
CRYPTO_EXPORT_PRIVATE ScopedPK11Slot
OpenSoftwareNSSDB(const base::FilePath& path,
const std::string& description);
CRYPTO_EXPORT ScopedPK11Slot OpenSoftwareNSSDB(const base::FilePath& path,
const std::string& description);
#if !defined(OS_CHROMEOS)
// Returns a reference to the default NSS key slot for storing persistent data.
......@@ -59,7 +58,7 @@ CRYPTO_EXPORT ScopedPK11Slot GetSystemNSSKeySlot(
// does not have to be called if the test system slot is set.
// This must must not be called consecutively with a |slot| != NULL. If |slot|
// is NULL, the test system slot is unset.
CRYPTO_EXPORT_PRIVATE void SetSystemKeySlotForTesting(ScopedPK11Slot slot);
CRYPTO_EXPORT void SetSystemKeySlotForTesting(ScopedPK11Slot slot);
// Prepare per-user NSS slot mapping. It is safe to call this function multiple
// times. Returns true if the user was added, or false if it already existed.
......@@ -104,7 +103,7 @@ CRYPTO_EXPORT ScopedPK11Slot GetPrivateSlotForChromeOSUser(
// Closes the NSS DB for |username_hash| that was previously opened by the
// *Initialize*ForChromeOSUser functions.
CRYPTO_EXPORT_PRIVATE void CloseChromeOSUserForTesting(
CRYPTO_EXPORT void CloseChromeOSUserForTesting(
const std::string& username_hash);
#endif // defined(OS_CHROMEOS)
......
......@@ -16,7 +16,7 @@ namespace crypto {
// Opens a persistent NSS software database in a temporary directory for the
// user with |username_hash|. This database will be used for both the user's
// public and private slot.
class CRYPTO_EXPORT_PRIVATE ScopedTestNSSChromeOSUser {
class CRYPTO_EXPORT ScopedTestNSSChromeOSUser {
public:
// Opens the software database and sets the public slot for the user. The
// private slot will not be initialized until FinishInit() is called.
......
......@@ -15,7 +15,7 @@ namespace crypto {
// Opens a persistent NSS database in a temporary directory.
// Prior NSS version 3.15.1, because of http://bugzil.la/875601 , the opened DB
// will not be closed automatically.
class CRYPTO_EXPORT_PRIVATE ScopedTestNSSDB {
class CRYPTO_EXPORT ScopedTestNSSDB {
public:
ScopedTestNSSDB();
~ScopedTestNSSDB();
......
......@@ -24,7 +24,7 @@ class ScopedTestNSSDB;
// |InitializeTPMTokenAndSystemSlot|, which triggers the TPM initialization,
// does not have to be called if this helper is used.
// At most one instance of this helper must be used at a time.
class CRYPTO_EXPORT_PRIVATE ScopedTestSystemNSSKeySlot {
class CRYPTO_EXPORT ScopedTestSystemNSSKeySlot {
public:
explicit ScopedTestSystemNSSKeySlot();
~ScopedTestSystemNSSKeySlot();
......
......@@ -13,16 +13,13 @@
#if defined(SANDBOX_IMPLEMENTATION)
#define SANDBOX_EXPORT __attribute__((visibility("default")))
#define SANDBOX_EXPORT_PRIVATE __attribute__((visibility("default")))
#else
#define SANDBOX_EXPORT
#define SANDBOX_EXPORT_PRIVATE
#endif // defined(SANDBOX_IMPLEMENTATION)
#else // defined(COMPONENT_BUILD)
#define SANDBOX_EXPORT
#define SANDBOX_EXPORT_PRIVATE
#endif // defined(COMPONENT_BUILD)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment