Fix declarations marked by wrong export macros (WEBCORE_EXPORT and WTF_EXPORT)
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Feb 2020 01:59:28 +0000 (01:59 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Feb 2020 01:59:28 +0000 (01:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=207453

Reviewed by Ross Kirsling.

Source/WebCore:

No new tests because there is no behavior change.

* rendering/RenderTheme.h:
* testing/MockContentFilterSettings.h:
* testing/MockGamepadProvider.h:

Source/WebKit:

* UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
* UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.h:

Source/WebKitLegacy:

* Storage/InProcessIDBServer.h:

Source/WebKitLegacy/win:

* Plugins/PluginMainThreadScheduler.h:

Source/WTF:

Export macros are prone to be misused because thier definitions
are identical for POSIX ports. They can be used interchangeably on
such ports.

WTF should use WTF_EXPORT_PRIVATE instead of WTF_EXPORT.

* wtf/HexNumber.h:
* wtf/Language.h:
* wtf/Logger.h:
* wtf/ProcessPrivilege.h:
* wtf/cocoa/CrashReporter.h:
* wtf/cocoa/Entitlements.h:
* wtf/text/LineEnding.h:
* wtf/text/TextBreakIterator.h:
* wtf/text/icu/UTextProviderLatin1.h:
Replaced WTF_EXPORT with WTF_EXPORT_PRIVATE.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256420 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/HexNumber.h
Source/WTF/wtf/Language.h
Source/WTF/wtf/Logger.h
Source/WTF/wtf/ProcessPrivilege.h
Source/WTF/wtf/cocoa/CrashReporter.h
Source/WTF/wtf/cocoa/Entitlements.h
Source/WTF/wtf/text/LineEnding.h
Source/WTF/wtf/text/TextBreakIterator.h
Source/WTF/wtf/text/icu/UTextProviderLatin1.h
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/testing/MockContentFilterSettings.h
Source/WebCore/testing/MockGamepadProvider.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h
Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.h
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/Storage/InProcessIDBServer.h
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/Plugins/PluginMainThreadScheduler.h

index 2d120ae..5e54cd4 100644 (file)
@@ -1,3 +1,27 @@
+2020-02-11  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        Fix declarations marked by wrong export macros (WEBCORE_EXPORT and WTF_EXPORT)
+        https://bugs.webkit.org/show_bug.cgi?id=207453
+
+        Reviewed by Ross Kirsling.
+
+        Export macros are prone to be misused because thier definitions
+        are identical for POSIX ports. They can be used interchangeably on
+        such ports.
+
+        WTF should use WTF_EXPORT_PRIVATE instead of WTF_EXPORT.
+
+        * wtf/HexNumber.h:
+        * wtf/Language.h:
+        * wtf/Logger.h:
+        * wtf/ProcessPrivilege.h:
+        * wtf/cocoa/CrashReporter.h:
+        * wtf/cocoa/Entitlements.h:
+        * wtf/text/LineEnding.h:
+        * wtf/text/TextBreakIterator.h:
+        * wtf/text/icu/UTextProviderLatin1.h:
+        Replaced WTF_EXPORT with WTF_EXPORT_PRIVATE.
+
 2020-02-11  Eric Carlson  <eric.carlson@apple.com>
 
         Support in-band VTT captions when loading media in the GPU Process
index e10ce57..46dde0c 100644 (file)
@@ -37,7 +37,7 @@ inline const LChar* hexDigitsForMode(HexConversionMode mode)
     return mode == Lowercase ? lowercaseHexDigits : uppercaseHexDigits;
 }
 
-WTF_EXPORT std::pair<LChar*, unsigned> appendHex(LChar* buffer, unsigned bufferSize, std::uintmax_t number, unsigned minimumDigits, HexConversionMode);
+WTF_EXPORT_PRIVATE std::pair<LChar*, unsigned> appendHex(LChar* buffer, unsigned bufferSize, std::uintmax_t number, unsigned minimumDigits, HexConversionMode);
 
 template<size_t arraySize, typename NumberType>
 inline std::pair<LChar*, unsigned> appendHex(std::array<LChar, arraySize>& buffer, NumberType number, unsigned minimumDigits, HexConversionMode mode)
index 99929af..69bf2f3 100644 (file)
 
 namespace WTF {
 
-WTF_EXPORT String defaultLanguage(); // Thread-safe.
-WTF_EXPORT Vector<String> userPreferredLanguages(); // Thread-safe, returns BCP 47 language tags.
-WTF_EXPORT Vector<String> userPreferredLanguagesOverride();
-WTF_EXPORT void overrideUserPreferredLanguages(const Vector<String>&);
-WTF_EXPORT size_t indexOfBestMatchingLanguageInList(const String& language, const Vector<String>& languageList, bool& exactMatch);
-WTF_EXPORT Vector<String> platformUserPreferredLanguages();
+WTF_EXPORT_PRIVATE String defaultLanguage(); // Thread-safe.
+WTF_EXPORT_PRIVATE Vector<String> userPreferredLanguages(); // Thread-safe, returns BCP 47 language tags.
+WTF_EXPORT_PRIVATE Vector<String> userPreferredLanguagesOverride();
+WTF_EXPORT_PRIVATE void overrideUserPreferredLanguages(const Vector<String>&);
+WTF_EXPORT_PRIVATE size_t indexOfBestMatchingLanguageInList(const String& language, const Vector<String>& languageList, bool& exactMatch);
+WTF_EXPORT_PRIVATE Vector<String> platformUserPreferredLanguages();
 // Called from platform specific code when the user's preferred language(s) change.
 void languageDidChange();
 
 // The observer function will be called when system language changes.
 typedef void (*LanguageChangeObserverFunction)(void* context);
-WTF_EXPORT void addLanguageChangeObserver(void* context, LanguageChangeObserverFunction);
-WTF_EXPORT void removeLanguageChangeObserver(void* context);
-WTF_EXPORT String displayNameForLanguageLocale(const String&);
+WTF_EXPORT_PRIVATE void addLanguageChangeObserver(void* context, LanguageChangeObserverFunction);
+WTF_EXPORT_PRIVATE void removeLanguageChangeObserver(void* context);
+WTF_EXPORT_PRIVATE String displayNameForLanguageLocale(const String&);
 
 #if PLATFORM(COCOA)
 bool canMinimizeLanguages();
index 94660e5..4f238ce 100644 (file)
@@ -210,7 +210,7 @@ public:
         {
         }
 
-        WTF_EXPORT String toString() const;
+        WTF_EXPORT_PRIVATE String toString() const;
 
         const char* className { nullptr };
         const char* methodName { nullptr };
@@ -281,7 +281,7 @@ template<> struct LogArgument<Logger::LogSiteIdentifier> {
     static String toString(const Logger::LogSiteIdentifier& value) { return value.toString(); }
 };
 template<> struct LogArgument<const void*> {
-    WTF_EXPORT static String toString(const void*);
+    WTF_EXPORT_PRIVATE static String toString(const void*);
 };
 
 } // namespace WTF
index 7d99cb4..b05fab6 100644 (file)
@@ -35,11 +35,11 @@ enum class ProcessPrivilege {
     CanCommunicateWithWindowServer = 1 << 2,
 };
 
-WTF_EXPORT void setProcessPrivileges(OptionSet<ProcessPrivilege>);
-WTF_EXPORT void addProcessPrivilege(ProcessPrivilege);
-WTF_EXPORT void removeProcessPrivilege(ProcessPrivilege);
-WTF_EXPORT bool hasProcessPrivilege(ProcessPrivilege);
-WTF_EXPORT OptionSet<ProcessPrivilege> allPrivileges();
+WTF_EXPORT_PRIVATE void setProcessPrivileges(OptionSet<ProcessPrivilege>);
+WTF_EXPORT_PRIVATE void addProcessPrivilege(ProcessPrivilege);
+WTF_EXPORT_PRIVATE void removeProcessPrivilege(ProcessPrivilege);
+WTF_EXPORT_PRIVATE bool hasProcessPrivilege(ProcessPrivilege);
+WTF_EXPORT_PRIVATE OptionSet<ProcessPrivilege> allPrivileges();
 
 } // namespace WTF
 
index 29c5c1a..1f1dbcd 100644 (file)
@@ -27,6 +27,6 @@
 
 namespace WTF {
 
-WTF_EXPORT void setCrashLogMessage(const char*);
+WTF_EXPORT_PRIVATE void setCrashLogMessage(const char*);
 
 } // namespace WTF
index 71734eb..0068941 100644 (file)
@@ -31,9 +31,9 @@
 
 namespace WTF {
 
-WTF_EXPORT bool hasEntitlement(audit_token_t, const char* entitlement);
-WTF_EXPORT bool hasEntitlement(xpc_connection_t, const char* entitlement);
-WTF_EXPORT bool processHasEntitlement(const char* entitlement);
+WTF_EXPORT_PRIVATE bool hasEntitlement(audit_token_t, const char* entitlement);
+WTF_EXPORT_PRIVATE bool hasEntitlement(xpc_connection_t, const char* entitlement);
+WTF_EXPORT_PRIVATE bool processHasEntitlement(const char* entitlement);
 
 } // namespace WTF
 
index 8700a13..78eeb5e 100644 (file)
 namespace WTF {
 
 // Normalize all line-endings in the given string.
-WTF_EXPORT Vector<uint8_t> normalizeLineEndingsToLF(Vector<uint8_t>&&);
-WTF_EXPORT Vector<uint8_t> normalizeLineEndingsToCRLF(Vector<uint8_t>&&);
+WTF_EXPORT_PRIVATE Vector<uint8_t> normalizeLineEndingsToLF(Vector<uint8_t>&&);
+WTF_EXPORT_PRIVATE Vector<uint8_t> normalizeLineEndingsToCRLF(Vector<uint8_t>&&);
 
 // Normalize all line-endings to CRLF on Windows, to LF on all other platforms.
-WTF_EXPORT Vector<uint8_t> normalizeLineEndingsToNative(Vector<uint8_t>&&);
+WTF_EXPORT_PRIVATE Vector<uint8_t> normalizeLineEndingsToNative(Vector<uint8_t>&&);
 
 } // namespace WTF
 
index b9a4de1..9316488 100644 (file)
@@ -82,7 +82,7 @@ private:
     friend class TextBreakIteratorCache;
 
     // Use CachedTextBreakIterator instead of constructing one of these directly.
-    WTF_EXPORT TextBreakIterator(StringView, Mode, const AtomString& locale);
+    WTF_EXPORT_PRIVATE TextBreakIterator(StringView, Mode, const AtomString& locale);
 
     void setText(StringView string)
     {
index 337e826..46c9204 100644 (file)
@@ -38,7 +38,7 @@ struct UTextWithBuffer {
     UChar buffer[UTextWithBufferInlineCapacity];
 };
 
-WTF_EXPORT UText* openLatin1UTextProvider(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, UErrorCode* status);
+WTF_EXPORT_PRIVATE UText* openLatin1UTextProvider(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, UErrorCode* status);
 UText* openLatin1ContextAwareUTextProvider(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode* status);
 
 } // namespace WTF
index 7e95f70..f804de3 100644 (file)
@@ -1,3 +1,16 @@
+2020-02-11  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        Fix declarations marked by wrong export macros (WEBCORE_EXPORT and WTF_EXPORT)
+        https://bugs.webkit.org/show_bug.cgi?id=207453
+
+        Reviewed by Ross Kirsling.
+
+        No new tests because there is no behavior change.
+
+        * rendering/RenderTheme.h:
+        * testing/MockContentFilterSettings.h:
+        * testing/MockGamepadProvider.h:
+
 2020-02-11  Brent Fulgham  <bfulgham@apple.com>
 
         REGRESSION (r236025): Correct flaky WebGL2 test failures
index ff87688..4019d4f 100644 (file)
@@ -160,7 +160,7 @@ public:
 
     virtual Color disabledTextColor(const Color& textColor, const Color& backgroundColor) const;
 
-    WTF_EXPORT Color focusRingColor(OptionSet<StyleColor::Options>) const;
+    WEBCORE_EXPORT Color focusRingColor(OptionSet<StyleColor::Options>) const;
     virtual Color platformFocusRingColor(OptionSet<StyleColor::Options>) const { return Color(0, 0, 0); }
     static void setCustomFocusRingColor(const Color&);
     static float platformFocusRingWidth() { return 3; }
index 33d21a0..ae68d4a 100644 (file)
@@ -46,7 +46,7 @@ public:
         Block
     };
 
-    WTF_EXPORT_PRIVATE static MockContentFilterSettings& singleton();
+    WEBCORE_TESTSUPPORT_EXPORT static MockContentFilterSettings& singleton();
     static void reset();
     static const char* unblockURLHost() { return "mock-unblock"; }
 
@@ -55,7 +55,7 @@ public:
     void deref() { }
 
     bool enabled() const { return m_enabled; }
-    WTF_EXPORT_PRIVATE void setEnabled(bool);
+    WEBCORE_TESTSUPPORT_EXPORT void setEnabled(bool);
 
     const String& blockedString() const { return m_blockedString; }
     void setBlockedString(const String& blockedString) { m_blockedString = blockedString; }
index da776ed..a728841 100644 (file)
@@ -37,10 +37,10 @@ class MockGamepadProvider : public GamepadProvider {
     WTF_MAKE_NONCOPYABLE(MockGamepadProvider);
     friend class NeverDestroyed<MockGamepadProvider>;
 public:
-    WEBCORE_EXPORT static MockGamepadProvider& singleton();
+    WEBCORE_TESTSUPPORT_EXPORT static MockGamepadProvider& singleton();
 
-    WEBCORE_EXPORT void startMonitoringGamepads(GamepadProviderClient&) final;
-    WEBCORE_EXPORT void stopMonitoringGamepads(GamepadProviderClient&) final;
+    WEBCORE_TESTSUPPORT_EXPORT void startMonitoringGamepads(GamepadProviderClient&) final;
+    WEBCORE_TESTSUPPORT_EXPORT void stopMonitoringGamepads(GamepadProviderClient&) final;
     const Vector<PlatformGamepad*>& platformGamepads() final { return m_connectedGamepadVector; }
     bool isMockGamepadProvider() const final { return true; }
 
index b540df4..5646dcf 100644 (file)
@@ -1,3 +1,13 @@
+2020-02-11  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        Fix declarations marked by wrong export macros (WEBCORE_EXPORT and WTF_EXPORT)
+        https://bugs.webkit.org/show_bug.cgi?id=207453
+
+        Reviewed by Ross Kirsling.
+
+        * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
+        * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.h:
+
 2020-02-11  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         WebPage::getFocusedElementInformation should be robust when the focused element changes during layout
index 63e6d98..8bec1ea 100644 (file)
@@ -35,7 +35,7 @@ class ScrollerPairMac;
 
 class ScrollingTreeFrameScrollingNodeRemoteMac : public WebCore::ScrollingTreeFrameScrollingNodeMac {
 public:
-    WEBCORE_EXPORT static Ref<ScrollingTreeFrameScrollingNodeRemoteMac> create(WebCore::ScrollingTree&, WebCore::ScrollingNodeType, WebCore::ScrollingNodeID);
+    static Ref<ScrollingTreeFrameScrollingNodeRemoteMac> create(WebCore::ScrollingTree&, WebCore::ScrollingNodeType, WebCore::ScrollingNodeID);
     virtual ~ScrollingTreeFrameScrollingNodeRemoteMac();
 
     bool handleMouseEvent(const WebCore::PlatformMouseEvent&);
index 92d2ccc..284a6ec 100644 (file)
@@ -35,7 +35,7 @@ class ScrollerPairMac;
 
 class ScrollingTreeOverflowScrollingNodeRemoteMac : public WebCore::ScrollingTreeOverflowScrollingNodeMac {
 public:
-    WEBCORE_EXPORT static Ref<ScrollingTreeOverflowScrollingNodeRemoteMac> create(WebCore::ScrollingTree&, WebCore::ScrollingNodeID);
+    static Ref<ScrollingTreeOverflowScrollingNodeRemoteMac> create(WebCore::ScrollingTree&, WebCore::ScrollingNodeID);
     virtual ~ScrollingTreeOverflowScrollingNodeRemoteMac();
 
     bool handleMouseEvent(const WebCore::PlatformMouseEvent&);
index dab2a9e..1a99857 100644 (file)
@@ -1,5 +1,14 @@
 2020-02-11  Fujii Hironori  <Hironori.Fujii@sony.com>
 
+        Fix declarations marked by wrong export macros (WEBCORE_EXPORT and WTF_EXPORT)
+        https://bugs.webkit.org/show_bug.cgi?id=207453
+
+        Reviewed by Ross Kirsling.
+
+        * Storage/InProcessIDBServer.h:
+
+2020-02-11  Fujii Hironori  <Hironori.Fujii@sony.com>
+
         [Win][CMake][WK1] WebKitLegacyGUID doesn't get recompiled by updating IDL files
         https://bugs.webkit.org/show_bug.cgi?id=207456
 
index 34405c1..6047dd9 100644 (file)
@@ -55,10 +55,10 @@ class IDBServer;
 class InProcessIDBServer final : public WebCore::IDBClient::IDBConnectionToServerDelegate, public WebCore::IDBServer::IDBConnectionToClientDelegate, public ThreadSafeRefCounted<InProcessIDBServer> {
 public:
 
-    WEBCORE_EXPORT static Ref<InProcessIDBServer> create(PAL::SessionID);
-    WEBCORE_EXPORT static Ref<InProcessIDBServer> create(PAL::SessionID, const String& databaseDirectoryPath);
+    static Ref<InProcessIDBServer> create(PAL::SessionID);
+    static Ref<InProcessIDBServer> create(PAL::SessionID, const String& databaseDirectoryPath);
 
-    WEBCORE_EXPORT virtual ~InProcessIDBServer();
+    virtual ~InProcessIDBServer();
 
     WebCore::IDBClient::IDBConnectionToServer& connectionToServer() const;
     WebCore::IDBServer::IDBConnectionToClient& connectionToClient() const;
index 0a67a87..1836999 100644 (file)
@@ -1,3 +1,12 @@
+2020-02-11  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        Fix declarations marked by wrong export macros (WEBCORE_EXPORT and WTF_EXPORT)
+        https://bugs.webkit.org/show_bug.cgi?id=207453
+
+        Reviewed by Ross Kirsling.
+
+        * Plugins/PluginMainThreadScheduler.h:
+
 2020-02-07  Chris Dumez  <cdumez@apple.com>
 
         [Hardening] Validate Geolocation access permission on UIProcess side
index b15965a..7731a68 100644 (file)
@@ -41,12 +41,12 @@ class PluginMainThreadScheduler {
 public:
     typedef void MainThreadFunction(void*);
 
-    WEBCORE_EXPORT static PluginMainThreadScheduler& scheduler();
+    static PluginMainThreadScheduler& scheduler();
 
-    WEBCORE_EXPORT void scheduleCall(NPP, MainThreadFunction*, void* userData);
+    void scheduleCall(NPP, MainThreadFunction*, void* userData);
 
-    WEBCORE_EXPORT void registerPlugin(NPP);
-    WEBCORE_EXPORT void unregisterPlugin(NPP);
+    void registerPlugin(NPP);
+    void unregisterPlugin(NPP);
 
 private:
     friend NeverDestroyed<PluginMainThreadScheduler>;