Changeset 158971 in webkit
- Timestamp:
- Nov 8, 2013 4:25:24 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 deleted
- 8 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r158969 r158971 1 2013-11-08 Anders Carlsson <andersca@apple.com> 2 3 Begin stubbing out a KeyedEncoder class in WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=124079 5 6 Reviewed by Sam Weinig. 7 8 * WebCore.exp.in: 9 Add symbol needed by WebCore. 10 11 * WebCore.xcodeproj/project.pbxproj: 12 Add new header file. 13 14 * history/HistoryItem.cpp: 15 (WebCore::HistoryItem::encodeBackForwardTree): 16 * history/HistoryItem.h: 17 Add an encodeBackForwardTree overload that takes a KeyedEncoder object. Encode the version. 18 19 * platform/KeyedCoding.h: 20 Add a KeyedEncoder class that just has a single encodeUInt32 member function for now. 21 1 22 2013-11-08 Brady Eidson <beidson@apple.com> 2 23 -
trunk/Source/WebCore/WebCore.exp.in
r158873 r158971 1426 1426 __ZNK7WebCore11HistoryItem20hasCachedPageExpiredEv 1427 1427 __ZNK7WebCore11HistoryItem21encodeBackForwardTreeERN3WTF7EncoderE 1428 __ZNK7WebCore11HistoryItem21encodeBackForwardTreeERNS_12KeyedEncoderE 1428 1429 __ZNK7WebCore11HistoryItem3urlEv 1429 1430 __ZNK7WebCore11HistoryItem4copyEv -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r158969 r158971 757 757 1ADA14100E1AE5D900023EE5 /* PluginMainThreadScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ADA140E0E1AE5D900023EE5 /* PluginMainThreadScheduler.cpp */; }; 758 758 1ADA14110E1AE5D900023EE5 /* PluginMainThreadScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ADA140F0E1AE5D900023EE5 /* PluginMainThreadScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; }; 759 1AE00D59182DAC8D00087DD7 /* KeyedCoding.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE00D57182DAC8D00087DD7 /* KeyedCoding.h */; settings = {ATTRIBUTES = (Private, ); }; }; 759 760 1AE2AA1E0A1CDAB400B42B25 /* JSHTMLAreaElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE2AA0A0A1CDAB300B42B25 /* JSHTMLAreaElement.cpp */; }; 760 761 1AE2AA1F0A1CDAB400B42B25 /* JSHTMLAreaElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE2AA0B0A1CDAB300B42B25 /* JSHTMLAreaElement.h */; }; … … 7332 7333 1ADA140E0E1AE5D900023EE5 /* PluginMainThreadScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginMainThreadScheduler.cpp; sourceTree = "<group>"; }; 7333 7334 1ADA140F0E1AE5D900023EE5 /* PluginMainThreadScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginMainThreadScheduler.h; sourceTree = "<group>"; }; 7335 1AE00D57182DAC8D00087DD7 /* KeyedCoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyedCoding.h; sourceTree = "<group>"; }; 7334 7336 1AE2A9F00A1CDA5700B42B25 /* HTMLAreaElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLAreaElement.idl; sourceTree = "<group>"; }; 7335 7337 1AE2A9F10A1CDA5700B42B25 /* HTMLBaseFontElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLBaseFontElement.idl; sourceTree = "<group>"; }; … … 20050 20052 D630E2AB149BF344005B2F93 /* HistogramSupport.h */, 20051 20053 BC3BC29B0E91AB0F00835588 /* HostWindow.h */, 20054 1AE00D57182DAC8D00087DD7 /* KeyedCoding.h */, 20052 20055 521D46F711AEC9B100514613 /* KillRing.h */, 20053 20056 4306E4E514955543007F17AC /* KillRingNone.cpp */, 20054 6593923509AE4346002C531F /* URL.cpp */,20055 6593923609AE4346002C531F /* URL.h */,20056 BCBD21AA0E417AD400A070F2 /* URLHash.h */,20057 20057 E18772F0126E2629003DD586 /* Language.cpp */, 20058 20058 85EC9AF90A71A2C600EEEAED /* Language.h */, … … 20151 20151 9305B24C098F1B6B00C28855 /* Timer.h */, 20152 20152 1419D2C40CEA6F6100FF507A /* TreeShared.h */, 20153 6593923509AE4346002C531F /* URL.cpp */, 20154 6593923609AE4346002C531F /* URL.h */, 20155 BCBD21AA0E417AD400A070F2 /* URLHash.h */, 20153 20156 2E3BBF051162DA1100B9409A /* UUID.cpp */, 20154 20157 2E3BBF061162DA1100B9409A /* UUID.h */, … … 23443 23446 1C5FAED20DCFD90100D58F78 /* JSJavaScriptCallFrame.h in Headers */, 23444 23447 A86629D309DA2B48009633A5 /* JSKeyboardEvent.h in Headers */, 23448 1AE00D59182DAC8D00087DD7 /* KeyedCoding.h in Headers */, 23445 23449 935F45430F7C3B5F00D7C1FB /* JSLazyEventListener.h in Headers */, 23446 23450 BCE1C43C0D9830D3003B02F2 /* JSLocation.h in Headers */, -
trunk/Source/WebCore/history/HistoryItem.cpp
r157653 r158971 30 30 #include "Document.h" 31 31 #include "IconDatabase.h" 32 #include "KeyedCoding.h" 32 33 #include "PageCache.h" 33 34 #include "ResourceRequest.h" … … 683 684 } 684 685 686 void HistoryItem::encodeBackForwardTree(KeyedEncoder& encoder) const 687 { 688 encoder.encodeUInt32("version", backForwardTreeEncodingVersion); 689 690 // FIXME: Encode the tree. 691 } 692 685 693 void HistoryItem::encodeBackForwardTreeNode(Encoder& encoder) const 686 694 { -
trunk/Source/WebCore/history/HistoryItem.h
r157653 r158971 51 51 class HistoryItem; 52 52 class Image; 53 class KeyedEncoder; 54 class ResourceRequest; 53 55 class URL; 54 class ResourceRequest;55 56 56 57 typedef Vector<RefPtr<HistoryItem>> HistoryItemVector; … … 89 90 90 91 void encodeBackForwardTree(Encoder&) const; 92 void encodeBackForwardTree(KeyedEncoder&) const; 91 93 static PassRefPtr<HistoryItem> decodeBackForwardTree(const String& urlString, const String& title, const String& originalURLString, Decoder&); 92 94 -
trunk/Source/WebCore/platform/KeyedCoding.h
r158969 r158971 24 24 */ 25 25 26 #ifndef KeyedCoding ValueCF_h27 #define KeyedCoding ValueCF_h26 #ifndef KeyedCoding_h 27 #define KeyedCoding_h 28 28 29 #include "KeyedCodingValue.h" 30 #include <wtf/RetainPtr.h> 29 #include <wtf/Forward.h> 31 30 32 namespace Web Kit{31 namespace WebCore { 33 32 34 RetainPtr<CFTypeRef> toCFType(const KeyedCodingValue&); 33 class KeyedEncoder { 34 protected: 35 virtual ~KeyedEncoder() { } 35 36 36 } // namespace WebKit 37 public: 38 virtual void encodeUInt32(const String& key, uint32_t) = 0; 39 }; 37 40 38 #endif // KeyedCodingValueCF_h 41 } // namespace WebCore 42 43 #endif // KeyedCoding_h -
trunk/Source/WebKit2/ChangeLog
r158969 r158971 1 2013-11-08 Anders Carlsson <andersca@apple.com> 2 3 Begin stubbing out a KeyedEncoder class in WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=124079 5 6 Reviewed by Sam Weinig. 7 8 * Shared/KeyedEncoder.h: Removed. 9 * Shared/cf/KeyedCodingValueCF.cpp: Removed. 10 * Shared/cf/KeyedEncoder.cpp: Added. 11 Remove old keyed encoders. 12 13 (WebKit::createDictionary): 14 Helper function to create a mutable dictionary. 15 (WebKit::KeyedEncoder::KeyedEncoder): 16 Create the root dictionary. 17 18 (WebKit::KeyedEncoder::encodeUInt32): 19 Create a CFNumberRef and add it to the dictionary. 20 21 * Shared/cf/KeyedEncoder.h: Added. 22 * WebKit2.xcodeproj/project.pbxproj: 23 Add new files. 24 25 * WebProcess/WebPage/WebBackForwardListProxy.cpp: 26 (WebKit::updateBackForwardItem): 27 Create a KeyedEncoder and encode the history tree. 28 1 29 2013-11-08 Brady Eidson <beidson@apple.com> 2 30 -
trunk/Source/WebKit2/Shared/cf/KeyedEncoder.cpp
r158969 r158971 27 27 #include "KeyedEncoder.h" 28 28 29 #include "KeyedCodingValue.h"30 #include <wtf/text/ StringHash.h>29 #include <CoreFoundation/CoreFoundation.h> 30 #include <wtf/text/WTFString.h> 31 31 32 32 namespace WebKit { 33 33 34 static RetainPtr<CFMutableDictionaryRef> createDictionary() 35 { 36 return adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); 37 } 38 34 39 KeyedEncoder::KeyedEncoder() 35 : m_currentObject(&m_rootObject) 40 : m_rootDictionary(createDictionary()) 41 { 42 } 43 44 KeyedEncoder::~KeyedEncoder() 36 45 { 37 46 } 38 47 39 KeyedEncoder::~KeyedEncoder()48 void KeyedEncoder::encodeUInt32(const String& key, uint32_t value) 40 49 { 41 ASSERT(m_currentObject == &m_rootObject); 42 } 43 44 void KeyedEncoder::encode(const String& key, const String& value) 45 { 46 ASSERT(!m_currentObject->contains(key)); 47 48 KeyedCodingValue keyedCodingValue; 49 keyedCodingValue.type = KeyedCodingValue::StringValue; 50 keyedCodingValue.string = value; 51 52 m_currentObject->set(key, std::move(keyedCodingValue)); 50 RetainPtr<CFNumberRef> number = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value)); 51 CFDictionarySetValue(m_rootDictionary.get(), key.createCFString().get(), number.get()); 53 52 } 54 53 -
trunk/Source/WebKit2/Shared/cf/KeyedEncoder.h
r158969 r158971 24 24 */ 25 25 26 #ifndef Keyed CodingValue_h27 #define Keyed CodingValue_h26 #ifndef KeyedEncoder_h 27 #define KeyedEncoder_h 28 28 29 #include < wtf/HashMap.h>30 #include <wtf/ text/WTFString.h>29 #include <WebCore/KeyedCoding.h> 30 #include <wtf/RetainPtr.h> 31 31 32 32 namespace WebKit { 33 33 34 struct KeyedCodingValue { 35 enum Type { 36 StringValue, 37 ObjectValue 38 }; 34 class KeyedEncoder : public WebCore::KeyedEncoder { 35 public: 36 KeyedEncoder(); 37 ~KeyedEncoder(); 39 38 40 Type type; 41 String string; 42 HashMap<String, KeyedCodingValue> object; 39 private: 40 virtual void encodeUInt32(const String& key, uint32_t) OVERRIDE; 41 42 RetainPtr<CFMutableDictionaryRef> m_rootDictionary; 43 43 }; 44 44 45 45 } // namespace WebKit 46 46 47 #endif // Keyed CodingValue_h47 #endif // KeyedEncoder_h -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r158936 r158971 149 149 1A4A9F3312B844E2008FE984 /* PluginQuirks.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4A9F3112B844E2008FE984 /* PluginQuirks.h */; }; 150 150 1A50DB66110A3D57000D3FE5 /* WebProcess.app in Copy Files */ = {isa = PBXBuildFile; fileRef = 1A50DB1E110A3BDC000D3FE5 /* WebProcess.app */; }; 151 1A588B30174AAC7100ACF472 /* KeyedEncoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A588B2E174AAC7100ACF472 /* KeyedEncoder.cpp */; };152 1A588B31174AAC7100ACF472 /* KeyedEncoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A588B2F174AAC7100ACF472 /* KeyedEncoder.h */; };153 1A588B33174AAE0B00ACF472 /* KeyedCodingValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A588B32174AAE0B00ACF472 /* KeyedCodingValue.h */; };154 1A588B36174AB77000ACF472 /* KeyedCodingValueCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A588B34174AB77000ACF472 /* KeyedCodingValueCF.cpp */; };155 1A588B37174AB77000ACF472 /* KeyedCodingValueCF.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A588B35174AB77000ACF472 /* KeyedCodingValueCF.h */; };156 151 1A594ABA112A1FB6009DE7C7 /* WebUIClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A594AB8112A1FB6009DE7C7 /* WebUIClient.cpp */; }; 157 152 1A594ABB112A1FB6009DE7C7 /* WebUIClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A594AB9112A1FB6009DE7C7 /* WebUIClient.h */; }; … … 270 265 1AE00D4D182D6EB000087DD7 /* WKBrowsingContextHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE00D4B182D6EB000087DD7 /* WKBrowsingContextHandle.h */; }; 271 266 1AE00D4F182D6F5000087DD7 /* WKBrowsingContextHandleInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE00D4E182D6F5000087DD7 /* WKBrowsingContextHandleInternal.h */; }; 267 1AE00D5C182DADE100087DD7 /* KeyedEncoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE00D5A182DADE100087DD7 /* KeyedEncoder.cpp */; }; 268 1AE00D5D182DADE100087DD7 /* KeyedEncoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE00D5B182DADE100087DD7 /* KeyedEncoder.h */; }; 272 269 1AE117F611DBB30900981615 /* ProcessLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE117F511DBB30900981615 /* ProcessLauncher.cpp */; }; 273 270 1AE4976811FF658E0048B464 /* NPJSObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AE4976611FF658E0048B464 /* NPJSObject.h */; }; … … 1619 1616 1A4F976E100E7B6600637A18 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; }; 1620 1617 1A50DB1E110A3BDC000D3FE5 /* WebProcess.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WebProcess.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1621 1A588B2E174AAC7100ACF472 /* KeyedEncoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyedEncoder.cpp; sourceTree = "<group>"; };1622 1A588B2F174AAC7100ACF472 /* KeyedEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyedEncoder.h; sourceTree = "<group>"; };1623 1A588B32174AAE0B00ACF472 /* KeyedCodingValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyedCodingValue.h; sourceTree = "<group>"; };1624 1A588B34174AB77000ACF472 /* KeyedCodingValueCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyedCodingValueCF.cpp; sourceTree = "<group>"; };1625 1A588B35174AB77000ACF472 /* KeyedCodingValueCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyedCodingValueCF.h; sourceTree = "<group>"; };1626 1618 1A594AB8112A1FB6009DE7C7 /* WebUIClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebUIClient.cpp; sourceTree = "<group>"; }; 1627 1619 1A594AB9112A1FB6009DE7C7 /* WebUIClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebUIClient.h; sourceTree = "<group>"; }; … … 1757 1749 1AE00D4B182D6EB000087DD7 /* WKBrowsingContextHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBrowsingContextHandle.h; sourceTree = "<group>"; }; 1758 1750 1AE00D4E182D6F5000087DD7 /* WKBrowsingContextHandleInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBrowsingContextHandleInternal.h; sourceTree = "<group>"; }; 1751 1AE00D5A182DADE100087DD7 /* KeyedEncoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyedEncoder.cpp; sourceTree = "<group>"; }; 1752 1AE00D5B182DADE100087DD7 /* KeyedEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyedEncoder.h; sourceTree = "<group>"; }; 1759 1753 1AE117F511DBB30900981615 /* ProcessLauncher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessLauncher.cpp; sourceTree = "<group>"; }; 1760 1754 1AE4976611FF658E0048B464 /* NPJSObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NPJSObject.h; sourceTree = "<group>"; }; … … 3362 3356 BCBCB0CC1215E33A00DE59CA /* ImmutableDictionary.cpp */, 3363 3357 BCBCB0CA1215E32100DE59CA /* ImmutableDictionary.h */, 3364 1A588B32174AAE0B00ACF472 /* KeyedCodingValue.h */,3365 1A588B2E174AAC7100ACF472 /* KeyedEncoder.cpp */,3366 1A588B2F174AAC7100ACF472 /* KeyedEncoder.h */,3367 3358 1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */, 3368 3359 BCC8049D122F0D6B00103529 /* MutableArray.cpp */, … … 3510 3501 1AAF0C4912B16334008E49E2 /* ArgumentCodersCF.cpp */, 3511 3502 1AAF0C4812B16334008E49E2 /* ArgumentCodersCF.h */, 3512 1A 588B34174AB77000ACF472 /* KeyedCodingValueCF.cpp */,3513 1A 588B35174AB77000ACF472 /* KeyedCodingValueCF.h */,3503 1AE00D5A182DADE100087DD7 /* KeyedEncoder.cpp */, 3504 1AE00D5B182DADE100087DD7 /* KeyedEncoder.h */, 3514 3505 ); 3515 3506 path = cf; … … 5561 5552 1AE49A4911FFA8CE0048B464 /* JSNPMethod.h in Headers */, 5562 5553 1AE4987811FF7FAA0048B464 /* JSNPObject.h in Headers */, 5563 1A588B33174AAE0B00ACF472 /* KeyedCodingValue.h in Headers */,5564 1A588B37174AB77000ACF472 /* KeyedCodingValueCF.h in Headers */,5565 1A588B31174AAC7100ACF472 /* KeyedEncoder.h in Headers */,5566 5554 BCE0937814FB128C001138D9 /* LayerHostingContext.h in Headers */, 5567 5555 1A92DC1112F8BA460017AF65 /* LayerTreeContext.h in Headers */, … … 5927 5915 BCC938E11180DE440085E5FE /* WKContextPrivate.h in Headers */, 5928 5916 9FB5F395169E6A80002C25BF /* WKContextPrivateMac.h in Headers */, 5917 1AE00D5D182DADE100087DD7 /* KeyedEncoder.h in Headers */, 5929 5918 3309345B1315B9980097A7BC /* WKCookieManager.h in Headers */, 5930 5919 512F58FA12A88A5400629530 /* WKCredential.h in Headers */, … … 6861 6850 1AE49A4A11FFA8CE0048B464 /* JSNPMethod.cpp in Sources */, 6862 6851 1AE4987911FF7FAA0048B464 /* JSNPObject.cpp in Sources */, 6863 1A588B36174AB77000ACF472 /* KeyedCodingValueCF.cpp in Sources */,6864 1A588B30174AAC7100ACF472 /* KeyedEncoder.cpp in Sources */,6865 6852 BCE0937714FB128C001138D9 /* LayerHostingContext.mm in Sources */, 6866 6853 1A92DC1312F8BAB90017AF65 /* LayerTreeContextMac.mm in Sources */, … … 7167 7154 C0337DDD127A521C008FF4F4 /* WebPlatformTouchPoint.cpp in Sources */, 7168 7155 31D5929E166E060000E6BF02 /* WebPlugInClient.cpp in Sources */, 7156 1AE00D5C182DADE100087DD7 /* KeyedEncoder.cpp in Sources */, 7169 7157 1AC8702E130B49A2002C1257 /* WebPluginSiteDataManager.cpp in Sources */, 7170 7158 BCB9F8AF1124E07700A137E0 /* WebPolicyClient.cpp in Sources */, -
trunk/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp
r156598 r158971 29 29 #include "DataReference.h" 30 30 #include "EncoderAdapter.h" 31 #include "KeyedEncoder.h" 31 32 #include "WebCoreArgumentCoders.h" 32 33 #include "WebPage.h" … … 84 85 static void updateBackForwardItem(uint64_t itemID, HistoryItem* item) 85 86 { 87 KeyedEncoder keyedEncoder; 88 item->encodeBackForwardTree(keyedEncoder); 89 86 90 EncoderAdapter encoder; 87 91 item->encodeBackForwardTree(encoder);
Note: See TracChangeset
for help on using the changeset viewer.