Changeset 213737 in webkit
- Timestamp:
- Mar 10, 2017 4:58:42 PM (7 years ago)
- Location:
- trunk/Source/WebKit/win
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/win/ChangeLog
r213464 r213737 1 2017-03-10 Brent Fulgham <bfulgham@apple.com> 2 3 [Win] Re-export a few symbols for backwards compatibility 4 https://bugs.webkit.org/show_bug.cgi?id=169490 5 <rdar://problem/30983623> 6 7 Reviewed by Dean Jackson. 8 9 Re-introduce a workaround that re-exports a few JavaScriptCore functions 10 that had been erroneously exported by WebKit in older builds. This 11 is needed so that we do not break certain old software still being used. 12 13 * WebKitDLL.cpp: 14 (DllMain): Bind functions at startup. 15 (bindJavaScriptTrampoline): Find JavaScriptCore library functions and 16 re-export them from WebKit.dll. 17 * WebKitDLL.h: Only advertise these functions when building WebKt itself. 18 1 19 2017-03-06 Myles C. Maxfield <mmaxfield@apple.com> 2 20 -
trunk/Source/WebKit/win/WebKitDLL.cpp
r208505 r213737 1 1 /* 2 * Copyright (C) 2006 , 2007, 2014-2015Apple Inc. All rights reserved.2 * Copyright (C) 2006-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #define DEPRECATED_EXPORT_SYMBOLS 1 26 27 #include "WebKitDLL.h" 27 28 … … 66 67 } 67 68 69 void bindJavaScriptTrampoline(); 68 70 69 71 STDAPI_(BOOL) DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID /*lpReserved*/) … … 74 76 gInstance = hModule; 75 77 WebCore::setInstanceHandle(hModule); 78 bindJavaScriptTrampoline(); 76 79 return TRUE; 77 80 … … 220 223 return WebCore::SharedBuffer::create(reinterpret_cast<const char*>(resource), size); 221 224 } 225 226 // Force symbols to be included so we can export them for legacy clients. 227 // DEPRECATED! People should get these symbols from JavaScriptCore.dll, not WebKit.dll! 228 // #include <JavaScriptCore/JSObjectRef.h> 229 230 typedef JSClassRef (*JSClassCreateFunction)(const JSClassDefinition* definition); 231 typedef void* (*JSObjectGetPrivateFunction)(JSObjectRef); 232 typedef JSObjectRef (*JSObjectMakeFunctionStub)(JSContextRef, JSClassRef, void*); 233 typedef void (*JSObjectSetPropertyFunction)(JSContextRef, JSObjectRef, JSStringRef propertyName, JSValueRef, JSPropertyAttributes, JSValueRef* exception); 234 typedef JSStringRef (*JSStringCreateWithCFStringFunction)(CFStringRef); 235 typedef JSStringRef (*JSStringCreateWithUTF8CStringFunction)(const char*); 236 typedef const JSChar* (*JSStringGetCharactersPtrFunction)(JSStringRef); 237 typedef size_t (*JSStringGetLengthFunction)(JSStringRef); 238 typedef void (*JSStringReleaseFunction)(JSStringRef); 239 typedef bool (*JSValueIsTypeFunction)(JSContextRef, JSValueRef); 240 typedef JSValueRef(*JSValueMakeUndefinedFunction)(JSContextRef); 241 typedef double(*JSValueToNumberFunction)(JSContextRef, JSValueRef, JSValueRef* exception); 242 typedef JSValueRef(*JSValueMakeStringFunction)(JSContextRef, JSStringRef); 243 typedef JSStringRef (*JSValueToStringCopyFunction)(JSContextRef, JSValueRef, JSValueRef* exception); 244 245 JSClassCreateFunction m_jsClassCreateFunction = nullptr; 246 JSObjectGetPrivateFunction m_jsObjectGetPrivateFunction = nullptr; 247 JSObjectMakeFunctionStub m_jsObjectMakeFunction = nullptr; 248 JSObjectSetPropertyFunction m_jsObjectSetPropertyFunction = nullptr; 249 JSStringCreateWithCFStringFunction m_jsStringCreateWithCFStringFunction = nullptr; 250 JSStringCreateWithUTF8CStringFunction m_jsStringCreateWithUTF8CStringFunction = nullptr; 251 JSStringGetCharactersPtrFunction m_jsStringGetCharactersPtrFunction = nullptr; 252 JSStringGetLengthFunction m_jsStringGetLengthFunction = nullptr; 253 JSStringReleaseFunction m_jsStringReleaseFunction = nullptr; 254 JSValueIsTypeFunction m_jsValueIsNumberFunction = nullptr; 255 JSValueIsTypeFunction m_jsValueIsStringFunction = nullptr; 256 JSValueMakeUndefinedFunction m_jsValueMakeUndefinedFunction = nullptr; 257 JSValueToNumberFunction m_jsValueToNumberFunction = nullptr; 258 JSValueMakeStringFunction m_jsValueMakeStringFunction = nullptr; 259 JSValueToStringCopyFunction m_jsValueToStringCopyFunction = nullptr; 260 261 void bindJavaScriptTrampoline() 262 { 263 const wchar_t* libraryName = L"JavaScriptCore.dll"; 264 265 HMODULE library = ::LoadLibrary(libraryName); 266 if (!library) 267 return; 268 269 m_jsClassCreateFunction = reinterpret_cast<JSClassCreateFunction>(::GetProcAddress(library, "JSClassCreate")); 270 m_jsObjectGetPrivateFunction = reinterpret_cast<JSObjectGetPrivateFunction>(::GetProcAddress(library, "JSObjectGetPrivate")); 271 m_jsObjectMakeFunction = reinterpret_cast<JSObjectMakeFunctionStub>(::GetProcAddress(library, "JSObjectMake")); 272 m_jsObjectSetPropertyFunction = reinterpret_cast<JSObjectSetPropertyFunction>(::GetProcAddress(library, "JSObjectSetProperty"));; 273 m_jsStringCreateWithCFStringFunction = reinterpret_cast<JSStringCreateWithCFStringFunction>(::GetProcAddress(library, "JSStringCreateWithCFString")); 274 m_jsStringCreateWithUTF8CStringFunction = reinterpret_cast<JSStringCreateWithUTF8CStringFunction>(::GetProcAddress(library, "JSStringCreateWithUTF8CString")); 275 m_jsStringGetCharactersPtrFunction = reinterpret_cast<JSStringGetCharactersPtrFunction>(::GetProcAddress(library, "JSStringGetCharactersPtr")); 276 m_jsStringGetLengthFunction = reinterpret_cast<JSStringGetLengthFunction>(::GetProcAddress(library, "JSStringGetLength")); 277 m_jsStringReleaseFunction = reinterpret_cast<JSStringReleaseFunction>(::GetProcAddress(library, "JSStringRelease")); 278 m_jsValueIsNumberFunction = reinterpret_cast<JSValueIsTypeFunction>(::GetProcAddress(library, "JSValueIsNumber")); 279 m_jsValueIsStringFunction = reinterpret_cast<JSValueIsTypeFunction>(::GetProcAddress(library, "JSValueIsString")); 280 m_jsValueMakeStringFunction = reinterpret_cast<JSValueMakeStringFunction>(::GetProcAddress(library, "JSValueMakeString")); 281 m_jsValueMakeUndefinedFunction = reinterpret_cast<JSValueMakeUndefinedFunction>(::GetProcAddress(library, "JSValueMakeUndefined")); 282 m_jsValueToNumberFunction = reinterpret_cast<JSValueToNumberFunction>(::GetProcAddress(library, "JSValueToNumber")); 283 m_jsValueToStringCopyFunction = reinterpret_cast<JSValueToStringCopyFunction>(::GetProcAddress(library, "JSValueToStringCopy")); 284 } 285 286 extern "C" 287 { 288 289 JSClassRef JSClassCreate(const JSClassDefinition* definition) 290 { 291 if (m_jsClassCreateFunction) 292 return m_jsClassCreateFunction(definition); 293 return nullptr; 294 } 295 296 void* JSObjectGetPrivate(JSObjectRef object) 297 { 298 if (m_jsObjectGetPrivateFunction) 299 return m_jsObjectGetPrivateFunction(object); 300 return nullptr; 301 } 302 303 JSObjectRef JSObjectMake(JSContextRef ctx, JSClassRef classRef, void* data) 304 { 305 if (m_jsObjectMakeFunction) 306 return m_jsObjectMakeFunction(ctx, classRef, data); 307 return nullptr; 308 } 309 310 void JSObjectSetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSPropertyAttributes attributes, JSValueRef* exception) 311 { 312 if (m_jsObjectSetPropertyFunction) 313 m_jsObjectSetPropertyFunction(ctx, object, propertyName, value, attributes, exception); 314 } 315 316 JSStringRef JSStringCreateWithCFString(CFStringRef value) 317 { 318 if (m_jsStringCreateWithCFStringFunction) 319 return m_jsStringCreateWithCFStringFunction(value); 320 return nullptr; 321 } 322 323 JSStringRef JSStringCreateWithUTF8CString(const char* value) 324 { 325 if (m_jsStringCreateWithUTF8CStringFunction) 326 return m_jsStringCreateWithUTF8CStringFunction(value); 327 return nullptr; 328 } 329 330 const JSChar* JSStringGetCharactersPtr(JSStringRef value) 331 { 332 if (m_jsStringGetCharactersPtrFunction) 333 return m_jsStringGetCharactersPtrFunction(value); 334 return nullptr; 335 } 336 337 size_t JSStringGetLength(JSStringRef value) 338 { 339 if (m_jsStringGetLengthFunction) 340 return m_jsStringGetLengthFunction(value); 341 return 0; 342 } 343 344 void JSStringRelease(JSStringRef value) 345 { 346 if (m_jsStringReleaseFunction) 347 return m_jsStringReleaseFunction(value); 348 } 349 350 bool JSValueIsNumber(JSContextRef ctx, JSValueRef value) 351 { 352 if (m_jsValueIsNumberFunction) 353 return m_jsValueIsNumberFunction(ctx, value); 354 return false; 355 } 356 357 bool JSValueIsString(JSContextRef ctx, JSValueRef value) 358 { 359 if (m_jsValueIsStringFunction) 360 return m_jsValueIsStringFunction(ctx, value); 361 return false; 362 } 363 364 JSValueRef JSValueMakeString(JSContextRef ctx, JSStringRef value) 365 { 366 if (m_jsValueMakeStringFunction) 367 return m_jsValueMakeStringFunction(ctx, value); 368 return nullptr; 369 } 370 371 JSValueRef JSValueMakeUndefined(JSContextRef ctx) 372 { 373 if (m_jsValueMakeUndefinedFunction) 374 return m_jsValueMakeUndefinedFunction(ctx); 375 return nullptr; 376 } 377 378 double JSValueToNumber(JSContextRef ctx, JSValueRef value, JSValueRef* exception) 379 { 380 if (m_jsValueToNumberFunction) 381 return m_jsValueToNumberFunction(ctx, value, exception); 382 return 0; 383 } 384 385 JSStringRef JSValueToStringCopy(JSContextRef ctx, JSValueRef value, JSValueRef* exception) 386 { 387 if (m_jsValueToStringCopyFunction) 388 return m_jsValueToStringCopyFunction(ctx, value, exception); 389 return nullptr; 390 } 391 392 } -
trunk/Source/WebKit/win/WebKitDLL.h
r180653 r213737 1 1 /* 2 * Copyright (C) 2006 , 2007 Apple Inc. All rights reserved.2 * Copyright (C) 2006-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 57 57 WEBKIT_API void shutDownWebKit(); 58 58 59 #if defined(DEPRECATED_EXPORT_SYMBOLS) 60 61 #include <JavaScriptCore/JSObjectRef.h> 62 63 // Force symbols to be included so we can export them for legacy clients. 64 // DEPRECATED! People should get these symbols from JavaScriptCore.dll, not WebKit.dll! 65 typedef struct OpaqueJSClass* JSClassRef; 66 typedef const struct OpaqueJSContext* JSContextRef; 67 typedef const struct OpaqueJSValue* JSValueRef; 68 typedef struct OpaqueJSString* JSStringRef; 69 typedef wchar_t JSChar; 70 typedef unsigned JSPropertyAttributes; 71 72 WEBKIT_API JSClassRef JSClassCreate(const JSClassDefinition*); 73 WEBKIT_API void* JSObjectGetPrivate(JSObjectRef); 74 WEBKIT_API JSObjectRef JSObjectMake(JSContextRef, JSClassRef, void*); 75 WEBKIT_API void JSObjectSetProperty(JSContextRef, JSObjectRef, JSStringRef propertyName, JSValueRef, JSPropertyAttributes, JSValueRef* exception); 76 WEBKIT_API JSStringRef JSStringCreateWithCFString(CFStringRef); 77 WEBKIT_API JSStringRef JSStringCreateWithUTF8CString(const char*); 78 WEBKIT_API const JSChar* JSStringGetCharactersPtr(JSStringRef); 79 WEBKIT_API size_t JSStringGetLength(JSStringRef); 80 WEBKIT_API void JSStringRelease(JSStringRef); 81 WEBKIT_API bool JSValueIsNumber(JSContextRef, JSValueRef); 82 WEBKIT_API bool JSValueIsString(JSContextRef, JSValueRef); 83 WEBKIT_API JSValueRef JSValueMakeString(JSContextRef, JSStringRef); 84 WEBKIT_API JSValueRef JSValueMakeUndefined(JSContextRef ctx); 85 WEBKIT_API double JSValueToNumber(JSContextRef, JSValueRef, JSValueRef*); 86 WEBKIT_API JSStringRef JSValueToStringCopy(JSContextRef, JSValueRef, JSValueRef* exception); 87 // End 88 #endif 89 59 90 #ifdef __cplusplus 60 91 }
Note: See TracChangeset
for help on using the changeset viewer.