Changeset 213747 in webkit
- Timestamp:
- Mar 10, 2017 7:24:30 PM (7 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r213746 r213747 1 2017-03-10 Alex Christensen <achristensen@webkit.org> 2 3 Add SPI to set NSURLSessionConfiguration.allowsCellularAccess from _WKProcessPoolConfiguration 4 https://bugs.webkit.org/show_bug.cgi?id=169500 5 <rdar://problem/29599569> 6 7 Reviewed by Joseph Pecoraro. 8 9 * NetworkProcess/NetworkProcessCreationParameters.cpp: 10 (WebKit::NetworkProcessCreationParameters::encode): 11 (WebKit::NetworkProcessCreationParameters::decode): 12 * NetworkProcess/NetworkProcessCreationParameters.h: 13 * NetworkProcess/cocoa/NetworkProcessCocoa.mm: 14 (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): 15 * NetworkProcess/cocoa/NetworkSessionCocoa.h: 16 * NetworkProcess/cocoa/NetworkSessionCocoa.mm: 17 (WebKit::globalAllowsCellularAccess): 18 (WebKit::NetworkSessionCocoa::setAllowsCellularAccess): 19 (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): 20 * UIProcess/API/APIProcessPoolConfiguration.h: 21 * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: 22 * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: 23 (-[_WKProcessPoolConfiguration allowsCellularAccess]): 24 (-[_WKProcessPoolConfiguration setAllowsCellularAccess:]): 25 1 26 2017-03-10 Alex Christensen <achristensen@webkit.org> 2 27 -
trunk/Source/WebKit2/NetworkProcess/NetworkProcessCreationParameters.cpp
r212746 r213747 77 77 encoder << sourceApplicationBundleIdentifier; 78 78 encoder << sourceApplicationSecondaryIdentifier; 79 encoder << allowsCellularAccess; 79 80 #if PLATFORM(IOS) 80 81 encoder << ctDataConnectionServiceType; … … 164 165 if (!decoder.decode(result.sourceApplicationSecondaryIdentifier)) 165 166 return false; 167 if (!decoder.decode(result.allowsCellularAccess)) 168 return false; 166 169 #if PLATFORM(IOS) 167 170 if (!decoder.decode(result.ctDataConnectionServiceType)) -
trunk/Source/WebKit2/NetworkProcess/NetworkProcessCreationParameters.h
r212746 r213747 85 85 String sourceApplicationBundleIdentifier; 86 86 String sourceApplicationSecondaryIdentifier; 87 bool allowsCellularAccess { true }; 87 88 #if PLATFORM(IOS) 88 89 String ctDataConnectionServiceType; -
trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm
r212746 r213747 88 88 NetworkSessionCocoa::setSourceApplicationBundleIdentifier(parameters.sourceApplicationBundleIdentifier); 89 89 NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier(parameters.sourceApplicationSecondaryIdentifier); 90 NetworkSessionCocoa::setAllowsCellularAccess(parameters.allowsCellularAccess); 90 91 #if PLATFORM(IOS) 91 92 NetworkSessionCocoa::setCTDataConnectionServiceType(parameters.ctDataConnectionServiceType); -
trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.h
r213441 r213747 52 52 static void setSourceApplicationBundleIdentifier(const String&); 53 53 static void setSourceApplicationSecondaryIdentifier(const String&); 54 static void setAllowsCellularAccess(bool); 54 55 #if PLATFORM(IOS) 55 56 static void setCTDataConnectionServiceType(const String&); -
trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r213685 r213747 430 430 } 431 431 432 static bool& globalAllowsCellularAccess() 433 { 434 static bool allowsCellularAccess { true }; 435 return allowsCellularAccess; 436 } 437 432 438 static LegacyCustomProtocolManager*& globalLegacyCustomProtocolManager() 433 439 { … … 488 494 ASSERT(!sessionsCreated); 489 495 globalSourceApplicationSecondaryIdentifier() = identifier; 496 } 497 498 void NetworkSessionCocoa::setAllowsCellularAccess(bool value) 499 { 500 globalAllowsCellularAccess() = value; 490 501 } 491 502 … … 521 532 NSURLSessionConfiguration *configuration = configurationForSessionID(m_sessionID); 522 533 534 if (!globalAllowsCellularAccess()) 535 configuration.allowsCellularAccess = NO; 536 523 537 if (NetworkCache::singleton().isEnabled()) 524 538 configuration.URLCache = nil; -
trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h
r213690 r213747 112 112 void setSourceApplicationSecondaryIdentifier(const WTF::String& sourceApplicationSecondaryIdentifier) { m_sourceApplicationSecondaryIdentifier = sourceApplicationSecondaryIdentifier; } 113 113 114 bool allowsCellularAccess() const { return m_allowsCellularAccess; } 115 void setAllowsCellularAccess(bool allowsCellularAccess) { m_allowsCellularAccess = allowsCellularAccess; } 116 114 117 bool alwaysRunsAtBackgroundPriority() const { return m_alwaysRunsAtBackgroundPriority; } 115 118 void setAlwaysRunsAtBackgroundPriority(bool alwaysRunsAtBackgroundPriority) { m_alwaysRunsAtBackgroundPriority = alwaysRunsAtBackgroundPriority; } … … 146 149 WTF::String m_sourceApplicationBundleIdentifier; 147 150 WTF::String m_sourceApplicationSecondaryIdentifier; 151 bool m_allowsCellularAccess { true }; 148 152 bool m_alwaysRunsAtBackgroundPriority { false }; 149 153 #if PLATFORM(IOS) -
trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h
r207346 r213747 48 48 @property (nonatomic, nullable, copy) NSString *sourceApplicationBundleIdentifier WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 49 49 @property (nonatomic, nullable, copy) NSString *sourceApplicationSecondaryIdentifier WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 50 @property (nonatomic) BOOL allowsCellularAccess WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 50 51 #if TARGET_OS_IPHONE 51 52 @property (nonatomic, nullable, copy) NSString *CTDataConnectionServiceType WK_API_AVAILABLE(ios(WK_IOS_TBA)); -
trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm
r207346 r213747 172 172 } 173 173 174 - (BOOL)allowsCellularAccess 175 { 176 return _processPoolConfiguration->allowsCellularAccess(); 177 } 178 179 - (void)setAllowsCellularAccess:(BOOL)allowsCellularAccess 180 { 181 _processPoolConfiguration->setAllowsCellularAccess(allowsCellularAccess); 182 } 183 174 184 #if PLATFORM(IOS) 175 185 - (NSString *)CTDataConnectionServiceType
Note: See TracChangeset
for help on using the changeset viewer.