Changeset 260381 in webkit
- Timestamp:
- Apr 20, 2020, 11:41:29 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 15 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r260373 r260381 1 2020-04-20 David Kilzer <ddkilzer@apple.com> 2 3 [IPC hardening] Use ObjectIdentifier<> for geolocationID 4 <https://webkit.org/b/210680> 5 <rdar://problem/58892340> 6 7 Reviewed by Chris Dumez. 8 9 Replace uses of uint64_t with GeolocationIdentifier. 10 11 * Scripts/webkit/messages.py: 12 * UIProcess/GeolocationIdentifier.h: Add. 13 * UIProcess/GeolocationPermissionRequestManagerProxy.cpp: 14 (WebKit::GeolocationPermissionRequestManagerProxy::createRequest): 15 (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision): 16 * UIProcess/GeolocationPermissionRequestManagerProxy.h: 17 * UIProcess/GeolocationPermissionRequestProxy.cpp: 18 (WebKit::GeolocationPermissionRequestProxy::GeolocationPermissionRequestProxy): 19 * UIProcess/GeolocationPermissionRequestProxy.h: 20 (WebKit::GeolocationPermissionRequestProxy::create): 21 * UIProcess/WebPageProxy.cpp: 22 * UIProcess/WebPageProxy.h: 23 * UIProcess/WebPageProxy.messages.in: 24 * WebKit.xcodeproj/project.pbxproj: 25 * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: 26 (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation): 27 (WebKit::GeolocationPermissionRequestManager::cancelRequestForGeolocation): 28 (WebKit::GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision): 29 (WebKit::generateGeolocationID): Delete. 30 - Replace with GeolocationIdentifier::generate(). 31 * WebProcess/Geolocation/GeolocationPermissionRequestManager.h: 32 * WebProcess/WebPage/WebPage.cpp: 33 (WebKit::WebPage::didReceiveGeolocationPermissionDecision): 34 * WebProcess/WebPage/WebPage.h: 35 * WebProcess/WebPage/WebPage.messages.in: 36 1 37 2020-04-20 Chris Dumez <cdumez@apple.com> 2 38 -
trunk/Source/WebKit/Scripts/webkit/messages.py
r260191 r260381 1 # Copyright (C) 2010-20 19Apple Inc. All rights reserved.1 # Copyright (C) 2010-2020 Apple Inc. All rights reserved. 2 2 # 3 3 # Redistribution and use in source and binary forms, with or without … … 230 230 'WebKit::AudioMediaStreamTrackRendererIdentifier', 231 231 'WebKit::ContentWorldIdentifier', 232 'WebKit::GeolocationIdentifier', 232 233 'WebKit::ImageBufferBackendHandle', 233 234 'WebKit::ImageBufferFlushIdentifier', -
trunk/Source/WebKit/UIProcess/GeolocationIdentifier.h
r260380 r260381 1 1 /* 2 * Copyright (C) 20 11Apple Inc. All rights reserved.2 * Copyright (C) 2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include <wtf/HashMap.h> 29 #include <wtf/RefPtr.h> 30 31 namespace WebCore { 32 class Geolocation; 33 } 28 #include <wtf/ObjectIdentifier.h> 34 29 35 30 namespace WebKit { 36 31 37 class WebPage; 32 enum GeolocationIdentifierType { }; 33 using GeolocationIdentifier = ObjectIdentifier<GeolocationIdentifierType>; 38 34 39 class GeolocationPermissionRequestManager { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 explicit GeolocationPermissionRequestManager(WebPage&); 43 44 void startRequestForGeolocation(WebCore::Geolocation&); 45 void cancelRequestForGeolocation(WebCore::Geolocation&); 46 void revokeAuthorizationToken(const String&); 47 48 void didReceiveGeolocationPermissionDecision(uint64_t geolocationID, const String& authorizationToken); 49 50 private: 51 typedef HashMap<uint64_t, WebCore::Geolocation*> IDToGeolocationMap; 52 typedef HashMap<WebCore::Geolocation*, uint64_t> GeolocationToIDMap; 53 IDToGeolocationMap m_idToGeolocationMap; 54 GeolocationToIDMap m_geolocationToIDMap; 55 56 WebPage& m_page; 57 }; 58 59 } // namespace WebKit 35 } -
trunk/Source/WebKit/UIProcess/GeolocationPermissionRequestManagerProxy.cpp
r256075 r260381 1 1 /* 2 * Copyright (C) 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2011-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 47 47 } 48 48 49 Ref<GeolocationPermissionRequestProxy> GeolocationPermissionRequestManagerProxy::createRequest( uint64_tgeolocationID)49 Ref<GeolocationPermissionRequestProxy> GeolocationPermissionRequestManagerProxy::createRequest(GeolocationIdentifier geolocationID) 50 50 { 51 51 auto request = GeolocationPermissionRequestProxy::create(this, geolocationID); … … 54 54 } 55 55 56 void GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision( uint64_tgeolocationID, bool allowed)56 void GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision(GeolocationIdentifier geolocationID, bool allowed) 57 57 { 58 58 if (!m_page.hasRunningProcess()) -
trunk/Source/WebKit/UIProcess/GeolocationPermissionRequestManagerProxy.h
r256167 r260381 1 1 /* 2 * Copyright (C) 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2011-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 #define GeolocationPermissionRequestManagerProxy_h 28 28 29 #include "GeolocationIdentifier.h" 29 30 #include "GeolocationPermissionRequestProxy.h" 30 31 #include <wtf/HashMap.h> … … 43 44 44 45 // Create a request to be presented to the user. 45 Ref<GeolocationPermissionRequestProxy> createRequest( uint64_t geolocationID);46 Ref<GeolocationPermissionRequestProxy> createRequest(GeolocationIdentifier); 46 47 47 48 // Called by GeolocationPermissionRequestProxy when a decision is made by the user. 48 void didReceiveGeolocationPermissionDecision( uint64_t, bool allow);49 void didReceiveGeolocationPermissionDecision(GeolocationIdentifier, bool allow); 49 50 50 51 bool isValidAuthorizationToken(const String&) const; … … 52 53 53 54 private: 54 HashMap< uint64_t, RefPtr<GeolocationPermissionRequestProxy>> m_pendingRequests;55 HashMap<GeolocationIdentifier, RefPtr<GeolocationPermissionRequestProxy>> m_pendingRequests; 55 56 HashSet<String> m_validAuthorizationTokens; 56 57 WebPageProxy& m_page; -
trunk/Source/WebKit/UIProcess/GeolocationPermissionRequestProxy.cpp
r221764 r260381 1 1 /* 2 * Copyright (C) 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2011-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 31 31 namespace WebKit { 32 32 33 GeolocationPermissionRequestProxy::GeolocationPermissionRequestProxy(GeolocationPermissionRequestManagerProxy* manager, uint64_tgeolocationID)33 GeolocationPermissionRequestProxy::GeolocationPermissionRequestProxy(GeolocationPermissionRequestManagerProxy* manager, GeolocationIdentifier geolocationID) 34 34 : m_manager(manager) 35 35 , m_geolocationID(geolocationID) -
trunk/Source/WebKit/UIProcess/GeolocationPermissionRequestProxy.h
r221764 r260381 1 1 /* 2 * Copyright (C) 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2011-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 28 28 #include "APIObject.h" 29 #include "GeolocationIdentifier.h" 29 30 #include <wtf/Function.h> 30 31 … … 35 36 class GeolocationPermissionRequestProxy : public RefCounted<GeolocationPermissionRequestProxy> { 36 37 public: 37 static Ref<GeolocationPermissionRequestProxy> create(GeolocationPermissionRequestManagerProxy* manager, uint64_tgeolocationID)38 static Ref<GeolocationPermissionRequestProxy> create(GeolocationPermissionRequestManagerProxy* manager, GeolocationIdentifier geolocationID) 38 39 { 39 40 return adoptRef(*new GeolocationPermissionRequestProxy(manager, geolocationID)); … … 46 47 47 48 private: 48 GeolocationPermissionRequestProxy(GeolocationPermissionRequestManagerProxy*, uint64_t geolocationID);49 GeolocationPermissionRequestProxy(GeolocationPermissionRequestManagerProxy*, GeolocationIdentifier); 49 50 50 51 GeolocationPermissionRequestManagerProxy* m_manager; 51 uint64_tm_geolocationID;52 GeolocationIdentifier m_geolocationID; 52 53 }; 53 54 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r260373 r260381 7983 7983 } 7984 7984 7985 void WebPageProxy::requestGeolocationPermissionForFrame( uint64_tgeolocationID, FrameInfoData&& frameInfo)7985 void WebPageProxy::requestGeolocationPermissionForFrame(GeolocationIdentifier geolocationID, FrameInfoData&& frameInfo) 7986 7986 { 7987 7987 MESSAGE_CHECK(m_process, frameInfo.frameID); -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r260303 r260381 35 35 #include "EditorState.h" 36 36 #include "FocusedElementInformation.h" 37 #include "GeolocationIdentifier.h" 37 38 #include "GeolocationPermissionRequestManagerProxy.h" 38 39 #include "HiddenPageThrottlingAutoIncreasesCounter.h" … … 1892 1893 void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Messages::WebPageProxy::ReachedApplicationCacheOriginQuotaDelayedReply&&); 1893 1894 1894 void requestGeolocationPermissionForFrame( uint64_t geolocationID, FrameInfoData&&);1895 void requestGeolocationPermissionForFrame(GeolocationIdentifier, FrameInfoData&&); 1895 1896 void revokeGeolocationAuthorizationToken(const String& authorizationToken); 1896 1897 -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r260295 r260381 1 # Copyright (C) 2010-20 19Apple Inc. All rights reserved.1 # Copyright (C) 2010-2020 Apple Inc. All rights reserved. 2 2 # 3 3 # Redistribution and use in source and binary forms, with or without … … 281 281 282 282 # Geolocation messages 283 RequestGeolocationPermissionForFrame( uint64_tgeolocationID, struct WebKit::FrameInfoData frameInfo)283 RequestGeolocationPermissionForFrame(WebKit::GeolocationIdentifier geolocationID, struct WebKit::FrameInfoData frameInfo) 284 284 RevokeGeolocationAuthorizationToken(String authorizationToken); 285 285 -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r260350 r260381 1421 1421 9B5BEC2A240101580070C6EF /* RemoteAudioDestinationProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B5BEC28240101580070C6EF /* RemoteAudioDestinationProxy.h */; }; 1422 1422 9B5BEC31240102220070C6EF /* RemoteAudioBusData.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9B5BEC30240102220070C6EF /* RemoteAudioBusData.h */; }; 1423 9EC532A32447FBAD00215216 /* GeolocationIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 9EC532A22447FBAD00215216 /* GeolocationIdentifier.h */; }; 1423 1424 9FB5F395169E6A80002C25BF /* WKContextPrivateMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FB5F393169E6A80002C25BF /* WKContextPrivateMac.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1424 1425 A102A7081EC0EEE900D81D82 /* com.macromedia.Flash Player ESR.plugin.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 7A5E39491D5BD8A700B4B7CE /* com.macromedia.Flash Player ESR.plugin.sb */; }; … … 4486 4487 9BC59D6C1EFCCCB6001E8D09 /* CallbackID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallbackID.h; sourceTree = "<group>"; }; 4487 4488 9BC59D6D1EFCDC6D001E8D09 /* OptionalCallbackID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionalCallbackID.h; sourceTree = "<group>"; }; 4489 9EC532A22447FBAD00215216 /* GeolocationIdentifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeolocationIdentifier.h; sourceTree = "<group>"; }; 4488 4490 9F54F88E16488E87007DF81A /* AuxiliaryProcessMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AuxiliaryProcessMac.mm; sourceTree = "<group>"; }; 4489 4491 9F54F8941648AE0E007DF81A /* PluginProcessManagerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginProcessManagerMac.mm; sourceTree = "<group>"; }; … … 8909 8911 1AE00D5F1831792100087DD7 /* FrameLoadState.h */, 8910 8912 BC17753E118BABF0007D9E9A /* GenericCallback.h */, 8913 9EC532A22447FBAD00215216 /* GeolocationIdentifier.h */, 8911 8914 BC06F44912DBD1F5002D78DE /* GeolocationPermissionRequestManagerProxy.cpp */, 8912 8915 BC06F44812DBD1F5002D78DE /* GeolocationPermissionRequestManagerProxy.h */, … … 10776 10779 515BE1B31D5902DD00DD7C68 /* GamepadData.h in Headers */, 10777 10780 BC17753F118BABF0007D9E9A /* GenericCallback.h in Headers */, 10781 9EC532A32447FBAD00215216 /* GeolocationIdentifier.h in Headers */, 10778 10782 BC06F42F12DBB9B6002D78DE /* GeolocationPermissionRequestManager.h in Headers */, 10779 10783 BC06F44A12DBD1F5002D78DE /* GeolocationPermissionRequestManagerProxy.h in Headers */, -
trunk/Source/WebKit/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp
r257872 r260381 1 1 /* 2 * Copyright (C) 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2011-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 31 31 #include "FrameInfoData.h" 32 #include "GeolocationIdentifier.h" 32 33 #include "WebCoreArgumentCoders.h" 33 34 #include "WebFrame.h" … … 43 44 namespace WebKit { 44 45 using namespace WebCore; 45 46 static uint64_t generateGeolocationID()47 {48 static uint64_t uniqueGeolocationID = 1;49 return uniqueGeolocationID++;50 }51 46 52 47 GeolocationPermissionRequestManager::GeolocationPermissionRequestManager(WebPage& page) … … 65 60 } 66 61 67 uint64_t geolocationID = generateGeolocationID();62 GeolocationIdentifier geolocationID = GeolocationIdentifier::generate(); 68 63 69 64 m_geolocationToIDMap.set(&geolocation, geolocationID); … … 83 78 void GeolocationPermissionRequestManager::cancelRequestForGeolocation(Geolocation& geolocation) 84 79 { 85 uint64_tgeolocationID = m_geolocationToIDMap.take(&geolocation);80 GeolocationIdentifier geolocationID = m_geolocationToIDMap.take(&geolocation); 86 81 if (!geolocationID) 87 82 return; … … 89 84 } 90 85 91 void GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision( uint64_tgeolocationID, const String& authorizationToken)86 void GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision(GeolocationIdentifier geolocationID, const String& authorizationToken) 92 87 { 93 88 Geolocation* geolocation = m_idToGeolocationMap.take(geolocationID); -
trunk/Source/WebKit/WebProcess/Geolocation/GeolocationPermissionRequestManager.h
r256075 r260381 1 1 /* 2 * Copyright (C) 2011 Apple Inc. All rights reserved.2 * Copyright (C) 2011-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "GeolocationIdentifier.h" 28 29 #include <wtf/HashMap.h> 29 30 #include <wtf/RefPtr.h> … … 46 47 void revokeAuthorizationToken(const String&); 47 48 48 void didReceiveGeolocationPermissionDecision( uint64_t geolocationID, const String& authorizationToken);49 void didReceiveGeolocationPermissionDecision(GeolocationIdentifier, const String& authorizationToken); 49 50 50 51 private: 51 typedef HashMap< uint64_t, WebCore::Geolocation*> IDToGeolocationMap;52 typedef HashMap<WebCore::Geolocation*, uint64_t> GeolocationToIDMap;52 typedef HashMap<GeolocationIdentifier, WebCore::Geolocation*> IDToGeolocationMap; 53 typedef HashMap<WebCore::Geolocation*, GeolocationIdentifier> GeolocationToIDMap; 53 54 IDToGeolocationMap m_idToGeolocationMap; 54 55 GeolocationToIDMap m_geolocationToIDMap; -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r260317 r260381 4261 4261 4262 4262 #if ENABLE(GEOLOCATION) 4263 void WebPage::didReceiveGeolocationPermissionDecision( uint64_tgeolocationID, const String& authorizationToken)4263 void WebPage::didReceiveGeolocationPermissionDecision(GeolocationIdentifier geolocationID, const String& authorizationToken) 4264 4264 { 4265 4265 geolocationPermissionRequestManager().didReceiveGeolocationPermissionDecision(geolocationID, authorizationToken); -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r260303 r260381 38 38 #include "EditingRange.h" 39 39 #include "FocusedElementInformation.h" 40 #include "GeolocationIdentifier.h" 40 41 #include "InjectedBundlePageContextMenuClient.h" 41 42 #include "InjectedBundlePageFullScreenClient.h" … … 1594 1595 #endif 1595 1596 1596 void didReceiveGeolocationPermissionDecision( uint64_t geolocationID, const String& authorizationToken);1597 void didReceiveGeolocationPermissionDecision(GeolocationIdentifier, const String& authorizationToken); 1597 1598 1598 1599 void didReceiveNotificationPermissionDecision(uint64_t notificationID, bool allowed); -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r260303 r260381 1 # Copyright (C) 2010-20 19Apple Inc. All rights reserved.1 # Copyright (C) 2010-2020 Apple Inc. All rights reserved. 2 2 # 3 3 # Redistribution and use in source and binary forms, with or without … … 364 364 #if ENABLE(GEOLOCATION) 365 365 # Geolocation 366 DidReceiveGeolocationPermissionDecision( uint64_tgeolocationID, String authorizationToken)366 DidReceiveGeolocationPermissionDecision(WebKit::GeolocationIdentifier geolocationID, String authorizationToken) 367 367 #endif 368 368
Note:
See TracChangeset
for help on using the changeset viewer.