Changeset 170671 in webkit
- Timestamp:
- Jul 1, 2014, 3:34:10 PM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/API/C/WKPage.cpp (modified) (3 diffs)
-
UIProcess/mac/LegacySessionStateCoding.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r170670 r170671 1 2014-07-01 Anders Carlsson <andersca@apple.com> 2 3 Use the new legacy session state coding in WKPageCopySessionState 4 https://bugs.webkit.org/show_bug.cgi?id=134516 5 6 Reviewed by Tim Horton. 7 8 * UIProcess/API/C/WKPage.cpp: 9 (WKPageCopySessionState): 10 Call encodeLegacySessionState. 11 12 * UIProcess/mac/LegacySessionStateCoding.cpp: 13 (WebKit::encodeSessionHistoryEntryData): 14 Use leakPtr() so we won't attempt to double-free the buffer. 15 16 (WebKit::createDictionary): 17 Fix a typo. 18 19 (WebKit::encodeLegacySessionState): 20 Don't encode the provisional URL if it's empty. 21 1 22 2014-07-01 Chris Fleizach <cfleizach@apple.com> 2 23 -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r170657 r170671 35 35 #include "APIUIClient.h" 36 36 #include "ImmutableDictionary.h" 37 #include "LegacySessionStateCoding.h" 37 38 #include "NativeWebKeyboardEvent.h" 38 39 #include "NativeWebWheelEvent.h" … … 352 353 WKDataRef WKPageCopySessionState(WKPageRef pageRef, void *context, WKPageSessionStateFilterCallback filter) 353 354 { 354 return toAPI(toImpl(pageRef)->sessionStateData([pageRef, context, filter](WebBackForwardListItem& item) {355 auto sessionState = toImpl(pageRef)->sessionState([pageRef, context, filter](WebBackForwardListItem& item) { 355 356 if (filter) { 356 357 if (!filter(pageRef, WKPageGetSessionBackForwardListItemValueType(), toAPI(&item), context)) … … 362 363 363 364 return true; 364 }).leakRef()); 365 }); 366 367 return toAPI(encodeLegacySessionState(sessionState).release().leakRef()); 365 368 } 366 369 -
trunk/Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.cpp
r170658 r170671 402 402 auto buffer = encodeSessionHistoryEntryData(frameState, bufferSize); 403 403 404 return adoptCF(CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, buffer. get(), bufferSize, fastMallocDeallocator));404 return adoptCF(CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, buffer.leakPtr(), bufferSize, fastMallocDeallocator)); 405 405 } 406 406 … … 415 415 for (const auto& keyValuePair : keyValuePairs) { 416 416 keys.uncheckedAppend(keyValuePair.first); 417 keys.uncheckedAppend(keyValuePair.second);417 values.uncheckedAppend(keyValuePair.second); 418 418 } 419 419 … … 452 452 { 453 453 auto sessionHistoryDictionary = encodeSessionHistory(sessionState.backForwardListState); 454 auto provisionalURLString = sessionState.provisionalURL. string().createCFString();454 auto provisionalURLString = sessionState.provisionalURL.isNull() ? nullptr : sessionState.provisionalURL.string().createCFString(); 455 455 456 456 RetainPtr<CFDictionaryRef> stateDictionary;
Note:
See TracChangeset
for help on using the changeset viewer.