Skip to content

Commit

Permalink
Don't directly expose s_instanceHandle on Windows
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=248503

Reviewed by Alex Christensen and Fujii Hironori.

All accesses of `s_instanceHandle` used the getter/setter functions so
just remove it from the header. Export the functions so WebCore can be
turned into a shared library.

* Source/WebCore/platform/win/WebCoreInstanceHandle.cpp:
* Source/WebCore/platform/win/WebCoreInstanceHandle.h:

Canonical link: https://commits.webkit.org/257183@main
  • Loading branch information
donny-dont committed Nov 30, 2022
1 parent 370c4c4 commit 3223360
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
13 changes: 12 additions & 1 deletion Source/WebCore/platform/win/WebCoreInstanceHandle.cpp
Expand Up @@ -28,6 +28,17 @@

namespace WebCore {

HINSTANCE s_instanceHandle;
// The global DLL or application instance used for all windows.
HINSTANCE s_instanceHandle = nullptr;

void setInstanceHandle(HINSTANCE instanceHandle)
{
s_instanceHandle = instanceHandle;
}

HINSTANCE instanceHandle()
{
return s_instanceHandle;
}

} // namespace WebCore
12 changes: 3 additions & 9 deletions Source/WebCore/platform/win/WebCoreInstanceHandle.h
Expand Up @@ -23,19 +23,13 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef WebCoreInstanceHandle_h
#define WebCoreInstanceHandle_h
#pragma once

typedef struct HINSTANCE__* HINSTANCE;

namespace WebCore {

// The global DLL or application instance used for all windows.
extern HINSTANCE s_instanceHandle;

inline void setInstanceHandle(HINSTANCE instanceHandle) { s_instanceHandle = instanceHandle; }
inline HINSTANCE instanceHandle() { return s_instanceHandle; }
WEBCORE_EXPORT void setInstanceHandle(HINSTANCE);
WEBCORE_EXPORT HINSTANCE instanceHandle();

}

#endif // WebCoreInstanceHandle_h

0 comments on commit 3223360

Please sign in to comment.