Changeset 171240 in webkit


Ignore:
Timestamp:
Jul 18, 2014 1:50:11 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

[Cocoa] Use RetainPtr in _WKRemoteObjectInterface
https://bugs.webkit.org/show_bug.cgi?id=135062

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2014-07-18
Reviewed by Anders Carlsson.

Switch to RetainPtr instead of manual memory management of ivars.

  • Shared/API/Cocoa/_WKRemoteObjectInterface.h:
  • Shared/API/Cocoa/_WKRemoteObjectInterface.mm:

(-[_WKRemoteObjectInterface initWithProtocol:identifier:]):
(-[_WKRemoteObjectInterface identifier]):
(-[_WKRemoteObjectInterface description]):
(-[_WKRemoteObjectInterface dealloc]): Deleted.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r171239 r171240  
     12014-07-18  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        [Cocoa] Use RetainPtr in _WKRemoteObjectInterface
     4        https://bugs.webkit.org/show_bug.cgi?id=135062
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Switch to RetainPtr instead of manual memory management of ivars.
     9
     10        * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
     11        * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
     12        (-[_WKRemoteObjectInterface initWithProtocol:identifier:]):
     13        (-[_WKRemoteObjectInterface identifier]):
     14        (-[_WKRemoteObjectInterface description]):
     15        (-[_WKRemoteObjectInterface dealloc]): Deleted.
     16
    1172014-07-18  Tim Horton  <timothy_horton@apple.com>
    218
  • trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectInterface.h

    r168566 r171240  
    3737- (id)initWithProtocol:(Protocol *)protocol identifier:(NSString *)identifier;
    3838
    39 @property (readonly) Protocol *protocol;
    40 @property (readonly) NSString *identifier;
     39@property (readonly, nonatomic) Protocol *protocol;
     40@property (readonly, nonatomic) NSString *identifier;
    4141
    4242- (NSSet *)classesForSelector:(SEL)selector argumentIndex:(NSUInteger)argumentIndex;
  • trunk/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectInterface.mm

    r171098 r171240  
    4343@implementation _WKRemoteObjectInterface {
    4444    HashMap<SEL, Vector<RetainPtr<NSSet>>> _allowedArgumentClasses;
     45    RetainPtr<NSString> _identifier;
    4546}
    4647
     
    130131
    131132    _protocol = protocol;
    132     _identifier = [identifier copy];
     133    _identifier = adoptNS([identifier copy]);
    133134
    134135    initializeAllowedArgumentClasses(self);
     
    142143}
    143144
    144 - (void)dealloc
    145 {
    146     [_identifier release];
    147     [super dealloc];
     145- (NSString *)identifier
     146{
     147    return _identifier.get();
    148148}
    149149
    150150- (NSString *)description
    151151{
    152     return [NSString stringWithFormat:@"<%@: %p; protocol = \"%@\"; identifier = \"%@\">", NSStringFromClass(self.class), self, _identifier, NSStringFromProtocol(_protocol)];
     152    return [NSString stringWithFormat:@"<%@: %p; protocol = \"%@\"; identifier = \"%@\">", NSStringFromClass(self.class), self, _identifier.get(), NSStringFromProtocol(_protocol)];
    153153}
    154154
Note: See TracChangeset for help on using the changeset viewer.