Changeset 223966 in webkit
- Timestamp:
- Oct 25, 2017 11:38:48 AM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 added
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r223964 r223966 1 2017-10-25 Yousuke Kimoto <yousuke.kimoto@sony.com> 2 3 [WinCairo] Add WebKit platform files for wincairo webkit 4 https://bugs.webkit.org/show_bug.cgi?id=178000 5 6 Reviewed by Alex Christensen. 7 8 * Platform/Module.h: 9 * Platform/SharedMemory.h: 10 (WebKit::SharedMemory::handle const): 11 * Platform/win/LoggingWin.cpp: Added. It is based on Source/WebCore/platform/win/LoggingWin.cpp 12 (WebKit::logLevelString): 13 * Platform/win/ModuleWin.cpp: Added. 14 (WebKit::Module::load): 15 (WebKit::Module::unload): 16 (WebKit::Module::platformFunctionPointer const): 17 * Platform/win/SharedMemoryWin.cpp: Added. 18 (WebKit::SharedMemory::Handle::Handle): 19 (WebKit::SharedMemory::Handle::~Handle): 20 (WebKit::SharedMemory::Handle::isNull const): 21 (WebKit::SharedMemory::Handle::encode const): 22 (WebKit::SharedMemory::Handle::clear): 23 (WebKit::getDuplicatedHandle): 24 (WebKit::SharedMemory::Handle::decode): 25 (WebKit::protectAttribute): 26 (WebKit::SharedMemory::allocate): 27 (WebKit::SharedMemory::create): 28 (WebKit::accessRights): 29 (WebKit::SharedMemory::map): 30 (WebKit::SharedMemory::adopt): 31 (WebKit::SharedMemory::~SharedMemory): 32 (WebKit::SharedMemory::createHandle): 33 (WebKit::SharedMemory::systemPageSize): 34 * PlatformWin.cmake: 35 1 36 2017-10-25 Chris Dumez <cdumez@apple.com> 2 37 -
trunk/Source/WebKit/Platform/Module.h
r213576 r223966 1 1 /* 2 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2017 Sony Interactive Entertainment Inc. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 24 25 */ 25 26 26 #ifndef Module_h 27 #define Module_h 27 #pragma once 28 28 29 29 #include <wtf/Noncopyable.h> … … 65 65 66 66 String m_path; 67 #if PLATFORM(WIN) 68 HMODULE m_module; 69 #endif 67 70 #if USE(CF) 68 71 RetainPtr<CFBundleRef> m_bundle; … … 81 84 82 85 } 83 84 #endif -
trunk/Source/WebKit/Platform/SharedMemory.h
r209920 r223966 1 1 /* 2 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2017 Sony Interactive Entertainment Inc. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 24 25 */ 25 26 26 #ifndef SharedMemory_h 27 #define SharedMemory_h 27 #pragma once 28 28 29 29 #include <wtf/Forward.h> … … 80 80 mutable mach_port_t m_port; 81 81 size_t m_size; 82 #elif OS(WINDOWS) 83 mutable HANDLE m_handle; 84 size_t m_size; 82 85 #endif 83 86 }; … … 88 91 #if USE(UNIX_DOMAIN_SOCKETS) 89 92 static RefPtr<SharedMemory> wrapMap(void*, size_t, int fileDescriptor); 93 #endif 94 #if OS(WINDOWS) 95 static RefPtr<SharedMemory> adopt(HANDLE, size_t, Protection); 90 96 #endif 91 97 … … 100 106 return m_data; 101 107 } 108 109 #if OS(WINDOWS) 110 HANDLE handle() const { return m_handle; } 111 #endif 102 112 103 113 // Return the system page size in bytes. … … 120 130 #elif OS(DARWIN) 121 131 mach_port_t m_port; 132 #elif OS(WINDOWS) 133 HANDLE m_handle; 122 134 #endif 123 135 }; 124 136 125 137 }; 126 127 #endif // SharedMemory_h -
trunk/Source/WebKit/Platform/win/LoggingWin.cpp
r223965 r223966 1 1 /* 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2013 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2017 Sony Interactive Entertainment Inc. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 24 25 */ 25 26 26 #i fndef Module_h27 # define Module_h27 #include "config.h" 28 #include "Logging.h" 28 29 29 #include <wtf/Noncopyable.h> 30 #if !LOG_DISABLED || !RELEASE_LOG_DISABLED 31 32 #include <wtf/StdLibExtras.h> 30 33 #include <wtf/text/WTFString.h> 31 32 #if USE(CF)33 #include <wtf/RetainPtr.h>34 #endif35 36 #if USE(GLIB)37 typedef struct _GModule GModule;38 #endif39 34 40 35 namespace WebKit { 41 36 42 class Module { 43 WTF_MAKE_NONCOPYABLE(Module); 44 public: 45 Module(const String& path); 46 ~Module(); 37 static char* const loggingEnvironmentVariable = "WebKitLogging"; 47 38 48 bool load(); 49 // Note: On Mac this leaks the CFBundle to avoid crashes when a bundle is unloaded and there are 50 // live Objective-C objects whose methods come from that bundle. 51 void unload(); 39 String logLevelString() 40 { 41 DWORD length = GetEnvironmentVariableA(loggingEnvironmentVariable, 0, 0); 42 if (!length) 43 return emptyString(); 52 44 53 #if USE(CF) 54 String bundleIdentifier() const; 55 #endif 45 auto buffer = std::make_unique<char[]>(length); 56 46 57 template<typename FunctionType> FunctionType functionPointer(const char* functionName) const; 47 if (!GetEnvironmentVariableA(loggingEnvironmentVariable, buffer.get(), length)) 48 return emptyString(); 58 49 59 #if USE(CF) && !defined(__LP64__) 60 CFBundleRefNum bundleResourceMap(); 61 #endif 62 63 private: 64 void* platformFunctionPointer(const char* functionName) const; 65 66 String m_path; 67 #if USE(CF) 68 RetainPtr<CFBundleRef> m_bundle; 69 #if !defined(__LP64__) 70 CFBundleRefNum m_bundleResourceMap; 71 #endif 72 #elif USE(GLIB) 73 GModule* m_handle; 74 #endif 75 }; 76 77 template<typename FunctionType> FunctionType Module::functionPointer(const char* functionName) const 78 { 79 return reinterpret_cast<FunctionType>(platformFunctionPointer(functionName)); 50 return String(buffer.get()); 80 51 } 81 52 82 } 53 } // namespace WebKit 83 54 84 #endif 55 #endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED -
trunk/Source/WebKit/Platform/win/ModuleWin.cpp
r223965 r223966 1 1 /* 2 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2017 Sony Interactive Entertainment Inc. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 24 25 */ 25 26 26 #i fndef Module_h27 # define Module_h27 #include "config.h" 28 #include "Module.h" 28 29 29 #include <wtf/Noncopyable.h> 30 #include <wtf/text/WTFString.h> 31 32 #if USE(CF) 33 #include <wtf/RetainPtr.h> 34 #endif 35 36 #if USE(GLIB) 37 typedef struct _GModule GModule; 38 #endif 30 #include <shlwapi.h> 31 #include <wtf/text/CString.h> 39 32 40 33 namespace WebKit { 41 34 42 class Module { 43 WTF_MAKE_NONCOPYABLE(Module); 44 public: 45 Module(const String& path); 46 ~Module(); 35 bool Module::load() 36 { 37 ASSERT(!::PathIsRelativeW(m_path.charactersWithNullTermination().data())); 38 m_module = ::LoadLibraryExW(m_path.charactersWithNullTermination().data(), 0, LOAD_WITH_ALTERED_SEARCH_PATH); 39 return m_module; 40 } 47 41 48 bool load(); 49 // Note: On Mac this leaks the CFBundle to avoid crashes when a bundle is unloaded and there are 50 // live Objective-C objects whose methods come from that bundle. 51 void unload(); 42 void Module::unload() 43 { 44 if (!m_module) 45 return; 46 ::FreeLibrary(m_module); 47 m_module = 0; 48 } 52 49 53 #if USE(CF) 54 String bundleIdentifier() const; 55 #endif 56 57 template<typename FunctionType> FunctionType functionPointer(const char* functionName) const; 58 59 #if USE(CF) && !defined(__LP64__) 60 CFBundleRefNum bundleResourceMap(); 61 #endif 62 63 private: 64 void* platformFunctionPointer(const char* functionName) const; 65 66 String m_path; 67 #if USE(CF) 68 RetainPtr<CFBundleRef> m_bundle; 69 #if !defined(__LP64__) 70 CFBundleRefNum m_bundleResourceMap; 71 #endif 72 #elif USE(GLIB) 73 GModule* m_handle; 74 #endif 75 }; 76 77 template<typename FunctionType> FunctionType Module::functionPointer(const char* functionName) const 50 void* Module::platformFunctionPointer(const char* functionName) const 78 51 { 79 return reinterpret_cast<FunctionType>(platformFunctionPointer(functionName)); 52 if (!m_module) 53 return 0; 54 return ::GetProcAddress(m_module, functionName); 80 55 } 81 56 82 57 } 83 84 #endif -
trunk/Source/WebKit/PlatformWin.cmake
r223262 r223966 17 17 NetworkProcess/win/NetworkProcessMainWin.cpp 18 18 NetworkProcess/win/SystemProxyWin.cpp 19 20 Platform/win/LoggingWin.cpp 21 Platform/win/ModuleWin.cpp 22 Platform/win/SharedMemoryWin.cpp 19 23 20 24 Shared/Authentication/curl/AuthenticationManagerCurl.cpp
Note: See TracChangeset
for help on using the changeset viewer.