Commit 248b1cfb authored by tomernic's avatar tomernic

Reviewed by John Sullivan.

        WebHistoryItem now supports getting and setting arbitrary properties via _transientPropertyForKey: and
        -_setTransientProperty:forKey:.
        For now, these properties do not persist with the rest of the history data.  They are intended to hold transient
        per-history-item state, which is something that was until now difficult for a WebKit client app to do.
        
        * History/WebHistoryItemPrivate.h:
        * History/WebHistoryItem.m:
        (-[WebHistoryItemPrivate dealloc]):
        (-[WebHistoryItem _transientPropertyForKey:]):
        (-[WebHistoryItem _setTransientProperty:forKey:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15094 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent eb1db16a
2006-06-29 Tim Omernick <timo@apple.com>
Reviewed by John Sullivan.
WebHistoryItem now supports getting and setting arbitrary properties via _transientPropertyForKey: and
-_setTransientProperty:forKey:.
For now, these properties do not persist with the rest of the history data. They are intended to hold transient
per-history-item state, which is something that was until now difficult for a WebKit client app to do.
* History/WebHistoryItemPrivate.h:
* History/WebHistoryItem.m:
(-[WebHistoryItemPrivate dealloc]):
(-[WebHistoryItem _transientPropertyForKey:]):
(-[WebHistoryItem _setTransientProperty:forKey:]):
2006-06-29 Timothy Hatcher <timothy@apple.com>
Reviewed by Harrison.
......
......@@ -79,6 +79,7 @@ @interface WebHistoryItemPrivate : NSObject
// info used to support RSS feeds
NSString *RSSFeedReferrer;
id viewState;
NSMutableDictionary *transientProperties;
}
@end
......@@ -99,6 +100,7 @@ - (void)dealloc
[formContentType release];
[formReferrer release];
[RSSFeedReferrer release];
[transientProperties release];
[super dealloc];
}
......@@ -765,6 +767,23 @@ - (NSMutableDictionary *)pageCache
return _private->pageCache;
}
- (id)_transientPropertyForKey:(NSString *)key
{
if (!_private->transientProperties)
return nil;
return [_private->transientProperties objectForKey:key];
}
- (void)_setTransientProperty:(id)property forKey:(NSString *)key
{
if (property) {
if (!_private->transientProperties)
_private->transientProperties = [[NSMutableDictionary alloc] init];
[_private->transientProperties setObject:property forKey:key];
} else if (_private->transientProperties)
[_private->transientProperties removeObjectForKey:key];
}
@end
......
......@@ -89,6 +89,11 @@
// in WebHistory. Use -[WebHistory setLastVisitedTimeInterval:forItem:] instead.
- (void)_setLastVisitedTimeInterval:(NSTimeInterval)time;
// Transient properties may be of any ObjC type. They are intended to be used to store state per back/forward list entry.
// The properties will not be persisted; when the history item is removed, the properties will be lost.
- (id)_transientPropertyForKey:(NSString *)key;
- (void)_setTransientProperty:(id)property forKey:(NSString *)key;
@end
@interface WebBackForwardList (WebPrivate)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment