Changeset 158538 in webkit
- Timestamp:
- Nov 3, 2013 12:41:01 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r158500 r158538 1 2013-11-03 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] Wrappers' -copyWithZone: should copy if the collection is mutable 4 https://bugs.webkit.org/show_bug.cgi?id=123707 5 6 Reviewed by Geoff Garen. 7 8 * Shared/Cocoa/WKNSArray.mm: 9 (-[WKNSArray copyWithZone:]): If the array is mutable, make a copy. 10 * Shared/Cocoa/WKNSDictionary.mm: 11 (-[WKNSDictionary copyWithZone:]): If the dictionary is mutable, make a copy. 12 * Shared/ImmutableArray.h: 13 (WebKit::ImmutableArray::entries): Added this accessor. 14 1 15 2013-11-02 Dan Bernstein <mitz@apple.com> 2 16 -
trunk/Source/WebKit2/Shared/Cocoa/WKNSArray.mm
r158500 r158538 59 59 - (id)copyWithZone:(NSZone *)zone 60 60 { 61 return [self retain]; 61 if (!reinterpret_cast<ImmutableArray*>(&_array)->isMutable()) 62 return [self retain]; 63 64 auto entries = reinterpret_cast<ImmutableArray*>(&_array)->entries(); 65 return ImmutableArray::adopt(entries).leakRef()->wrapper(); 62 66 } 63 67 -
trunk/Source/WebKit2/Shared/Cocoa/WKNSDictionary.mm
r158500 r158538 79 79 - (id)copyWithZone:(NSZone *)zone 80 80 { 81 return [self retain]; 81 if (!reinterpret_cast<ImmutableDictionary*>(&_dictionary)->isMutable()) 82 return [self retain]; 83 84 auto map = reinterpret_cast<ImmutableDictionary*>(&_dictionary)->map(); 85 return ImmutableDictionary::adopt(map).leakRef()->wrapper(); 82 86 } 83 87 -
trunk/Source/WebKit2/Shared/ImmutableArray.h
r155262 r158538 66 66 virtual bool isMutable() { return false; } 67 67 68 const Vector<RefPtr<APIObject>>& entries() { return m_entries; } 69 68 70 protected: 69 71 ImmutableArray();
Note: See TracChangeset
for help on using the changeset viewer.