Changeset 158784 in webkit


Ignore:
Timestamp:
Nov 6, 2013 1:52:54 PM (10 years ago)
Author:
andersca@apple.com
Message:

Implement more decoding methods
https://bugs.webkit.org/show_bug.cgi?id=123922

Reviewed by Dan Bernstein.

  • Shared/API/Cocoa/WKRemoteObjectCoder.mm:

(-[WKRemoteObjectDecoder decodeObjectForKey:]):
Call decodeObjectOfClasses:forKey: passing nil as the classes set.

(-[WKRemoteObjectDecoder decodeInt64ForKey:]):
Try to get a WebUInt64 and return its value.

(-[WKRemoteObjectDecoder decodeDoubleForKey:]):
Try to get a WebDouble and return its value.

(-[WKRemoteObjectDecoder decodeBytesForKey:returnedLength:]):
Move this method next to the other decoding methods.

(-[WKRemoteObjectDecoder requiresSecureCoding]):
Ditto.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r158782 r158784  
     12013-11-06  Anders Carlsson  <andersca@apple.com>
     2
     3        Implement more decoding methods
     4        https://bugs.webkit.org/show_bug.cgi?id=123922
     5
     6        Reviewed by Dan Bernstein.
     7
     8        * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
     9        (-[WKRemoteObjectDecoder decodeObjectForKey:]):
     10        Call decodeObjectOfClasses:forKey: passing nil as the classes set.
     11
     12        (-[WKRemoteObjectDecoder decodeInt64ForKey:]):
     13        Try to get a WebUInt64 and return its value.
     14
     15        (-[WKRemoteObjectDecoder decodeDoubleForKey:]):
     16        Try to get a WebDouble and return its value.
     17
     18        (-[WKRemoteObjectDecoder decodeBytesForKey:returnedLength:]):
     19        Move this method next to the other decoding methods.
     20
     21        (-[WKRemoteObjectDecoder requiresSecureCoding]):
     22        Ditto.
     23
    1242013-11-06  Brendan Long  <b.long@cablelabs.com>
    225
  • trunk/Source/WebKit2/Shared/API/Cocoa/WKRemoteObjectCoder.mm

    r158780 r158784  
    290290}
    291291
    292 - (const uint8_t *)decodeBytesForKey:(NSString *)key returnedLength:(NSUInteger *)length
    293 {
    294     WebData* data = _currentDictionary->get<WebData>(escapeKey(key));
    295     if (!data || !data->size())
    296         return nullptr;
    297 
    298     *length = data->size();
    299     return data->bytes();
    300 }
    301 
    302 - (BOOL)requiresSecureCoding
    303 {
    304     return YES;
     292- (id)decodeObjectForKey:(NSString *)key
     293{
     294    return [self decodeObjectOfClasses:nil forKey:key];
    305295}
    306296
     
    464454}
    465455
     456- (int64_t)decodeInt64ForKey:(NSString *)key
     457{
     458    const WebUInt64* value = _currentDictionary->get<WebUInt64>(escapeKey(key));
     459    if (!value)
     460        return 0;
     461    return value->value();
     462}
     463
     464- (double)decodeDoubleForKey:(NSString *)key
     465{
     466    const WebDouble* value = _currentDictionary->get<WebDouble>(escapeKey(key));
     467    if (!value)
     468        return 0;
     469    return value->value();
     470}
     471
     472- (const uint8_t *)decodeBytesForKey:(NSString *)key returnedLength:(NSUInteger *)length
     473{
     474    WebData* data = _currentDictionary->get<WebData>(escapeKey(key));
     475    if (!data || !data->size())
     476        return nullptr;
     477
     478    *length = data->size();
     479    return data->bytes();
     480}
     481
     482- (BOOL)requiresSecureCoding
     483{
     484    return YES;
     485}
     486
    466487- (id)decodeObjectOfClasses:(NSSet *)classes forKey:(NSString *)key
    467488{
Note: See TracChangeset for help on using the changeset viewer.