diff options
Diffstat (limited to 'WebKit/mac/History')
-rw-r--r-- | WebKit/mac/History/WebBackForwardList.mm | 30 | ||||
-rw-r--r-- | WebKit/mac/History/WebHistory.mm | 40 | ||||
-rw-r--r-- | WebKit/mac/History/WebHistoryInternal.h | 3 | ||||
-rw-r--r-- | WebKit/mac/History/WebHistoryItem.mm | 17 | ||||
-rw-r--r-- | WebKit/mac/History/WebHistoryItemInternal.h | 1 |
5 files changed, 28 insertions, 63 deletions
diff --git a/WebKit/mac/History/WebBackForwardList.mm b/WebKit/mac/History/WebBackForwardList.mm index 20988b8..2f0c214 100644 --- a/WebKit/mac/History/WebBackForwardList.mm +++ b/WebKit/mac/History/WebBackForwardList.mm @@ -82,7 +82,7 @@ WebBackForwardList *kit(BackForwardList* backForwardList) - (id)initWithBackForwardList:(PassRefPtr<BackForwardList>)backForwardList { - WebCoreThreadViolationCheck(); + WebCoreThreadViolationCheckRoundOne(); self = [super init]; if (!self) return nil; @@ -115,20 +115,26 @@ WebBackForwardList *kit(BackForwardList* backForwardList) return; BackForwardList* backForwardList = core(self); - ASSERT(backForwardList->closed()); - backForwardLists().remove(backForwardList); - backForwardList->deref(); - + ASSERT(backForwardList); + if (backForwardList) { + ASSERT(backForwardList->closed()); + backForwardLists().remove(backForwardList); + backForwardList->deref(); + } + [super dealloc]; } - (void)finalize { - WebCoreThreadViolationCheck(); + WebCoreThreadViolationCheckRoundOne(); BackForwardList* backForwardList = core(self); - ASSERT(backForwardList->closed()); - backForwardLists().remove(backForwardList); - backForwardList->deref(); + ASSERT(backForwardList); + if (backForwardList) { + ASSERT(backForwardList->closed()); + backForwardLists().remove(backForwardList); + backForwardList->deref(); + } [super finalize]; } @@ -138,7 +144,7 @@ WebBackForwardList *kit(BackForwardList* backForwardList) core(self)->close(); } -- (void)addItem:(WebHistoryItem *)entry; +- (void)addItem:(WebHistoryItem *)entry { core(self)->addItem(core(entry)); @@ -198,14 +204,14 @@ static NSArray* vectorToNSArray(HistoryItemVector& list) return result; } -- (NSArray *)backListWithLimit:(int)limit; +- (NSArray *)backListWithLimit:(int)limit { HistoryItemVector list; core(self)->backListWithLimit(limit, list); return vectorToNSArray(list); } -- (NSArray *)forwardListWithLimit:(int)limit; +- (NSArray *)forwardListWithLimit:(int)limit { HistoryItemVector list; core(self)->forwardListWithLimit(limit, list); diff --git a/WebKit/mac/History/WebHistory.mm b/WebKit/mac/History/WebHistory.mm index 417aadb..313378b 100644 --- a/WebKit/mac/History/WebHistory.mm +++ b/WebKit/mac/History/WebHistory.mm @@ -60,7 +60,6 @@ NSString *DatesArrayKey = @"WebHistoryDates"; NSMutableDictionary *_entriesByURL; DateToEntriesMap* _entriesByDate; NSMutableArray *_orderedLastVisitedDays; - WebHistoryItem *_lastVisitedEntry; BOOL itemLimitSet; int itemLimit; BOOL ageInDaysLimitSet; @@ -94,9 +93,6 @@ NSString *DatesArrayKey = @"WebHistoryDates"; - (void)addVisitedLinksToPageGroup:(PageGroup&)group; -- (WebHistoryItem *)lastVisitedEntry; -- (void)setLastVisitedEntry:(WebHistoryItem *)lastVisitedEntry; - @end @implementation WebHistoryPrivate @@ -127,7 +123,6 @@ NSString *DatesArrayKey = @"WebHistoryDates"; { [_entriesByURL release]; [_orderedLastVisitedDays release]; - [_lastVisitedEntry release]; delete _entriesByDate; [super dealloc]; } @@ -648,19 +643,6 @@ static WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval) } } -- (WebHistoryItem *)lastVisitedEntry -{ - return _lastVisitedEntry; -} - -- (void)setLastVisitedEntry:(WebHistoryItem *)lastVisitedEntry -{ - if (_lastVisitedEntry == lastVisitedEntry) - return; - [_lastVisitedEntry release]; - _lastVisitedEntry = [lastVisitedEntry retain]; -} - @end @implementation WebHistory @@ -821,39 +803,23 @@ static WebHistoryDateKey timeIntervalForBeginningOfDay(NSTimeInterval interval) @implementation WebHistory (WebInternal) -- (void)_visitedURL:(NSURL *)url withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure serverRedirectURL:(NSString *)serverRedirectURL isClientRedirect:(BOOL)isClientRedirect +- (void)_visitedURL:(NSURL *)url withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure { - if (isClientRedirect) { - ASSERT(!serverRedirectURL); - if (WebHistoryItem *lastVisitedEntry = [_historyPrivate lastVisitedEntry]) - core(lastVisitedEntry)->addRedirectURL([url _web_originalDataAsString]); - } - WebHistoryItem *entry = [_historyPrivate visitedURL:url withTitle:title]; - [_historyPrivate setLastVisitedEntry:entry]; HistoryItem* item = core(entry); item->setLastVisitWasFailure(wasFailure); if ([method length]) - item->setLastVisitWasHTTPNonGet([method caseInsensitiveCompare:@"GET"]); + item->setLastVisitWasHTTPNonGet([method caseInsensitiveCompare:@"GET"] && (![[url scheme] caseInsensitiveCompare:@"http"] || ![[url scheme] caseInsensitiveCompare:@"https"])); - if (serverRedirectURL) { - ASSERT(!isClientRedirect); - item->addRedirectURL(serverRedirectURL); - } + item->setRedirectURLs(std::auto_ptr<Vector<String> >()); NSArray *entries = [[NSArray alloc] initWithObjects:entry, nil]; [self _sendNotification:WebHistoryItemsAddedNotification entries:entries]; [entries release]; } -- (void)_visitedURLForRedirectWithoutHistoryItem:(NSURL *)url -{ - if (WebHistoryItem *lastVisitedEntry = [_historyPrivate lastVisitedEntry]) - core(lastVisitedEntry)->addRedirectURL([url _web_originalDataAsString]); -} - - (void)_addVisitedLinksToPageGroup:(WebCore::PageGroup&)group { [_historyPrivate addVisitedLinksToPageGroup:group]; diff --git a/WebKit/mac/History/WebHistoryInternal.h b/WebKit/mac/History/WebHistoryInternal.h index 9e69734..b4431c5 100644 --- a/WebKit/mac/History/WebHistoryInternal.h +++ b/WebKit/mac/History/WebHistoryInternal.h @@ -33,7 +33,6 @@ namespace WebCore { } @interface WebHistory (WebInternal) -- (void)_visitedURL:(NSURL *)URL withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure serverRedirectURL:(NSString *)serverRedirectURL isClientRedirect:(BOOL)isClientRedirect; -- (void)_visitedURLForRedirectWithoutHistoryItem:(NSURL *)url; +- (void)_visitedURL:(NSURL *)URL withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure; - (void)_addVisitedLinksToPageGroup:(WebCore::PageGroup&)group; @end diff --git a/WebKit/mac/History/WebHistoryItem.mm b/WebKit/mac/History/WebHistoryItem.mm index 1d2de1d..ca80437 100644 --- a/WebKit/mac/History/WebHistoryItem.mm +++ b/WebKit/mac/History/WebHistoryItem.mm @@ -107,7 +107,7 @@ void WKNotifyHistoryItemChanged() - (id)initWithURLString:(NSString *)URLString title:(NSString *)title lastVisitedTimeInterval:(NSTimeInterval)time { - WebCoreThreadViolationCheck(); + WebCoreThreadViolationCheckRoundOne(); return [self initWithWebCoreHistoryItem:HistoryItem::create(URLString, title, time)]; } @@ -126,7 +126,7 @@ void WKNotifyHistoryItemChanged() - (void)finalize { - WebCoreThreadViolationCheck(); + WebCoreThreadViolationCheckRoundOne(); // FIXME: ~HistoryItem is what releases the history item's icon from the icon database // It's probably not good to release icons from the database only when the object is garbage-collected. // Need to change design so this happens at a predictable time. @@ -140,7 +140,7 @@ void WKNotifyHistoryItemChanged() - (id)copyWithZone:(NSZone *)zone { - WebCoreThreadViolationCheck(); + WebCoreThreadViolationCheckRoundOne(); WebHistoryItem *copy = (WebHistoryItem *)NSCopyObject(self, 0, zone); RefPtr<HistoryItem> item = core(_private)->copy(); copy->_private = kitPrivate(item.get()); @@ -175,7 +175,7 @@ void WKNotifyHistoryItemChanged() core(_private)->setAlternateTitle(alternateTitle); } -- (NSString *)alternateTitle; +- (NSString *)alternateTitle { return nsStringNilIfEmpty(core(_private)->alternateTitle()); } @@ -299,7 +299,7 @@ static WebWindowWatcher *_windowWatcher = nil; - (id)initWithWebCoreHistoryItem:(PassRefPtr<HistoryItem>)item { - WebCoreThreadViolationCheck(); + WebCoreThreadViolationCheckRoundOne(); // Need to tell WebCore what function to call for the // "History Item has Changed" notification - no harm in doing this // everytime a WebHistoryItem is created @@ -325,7 +325,7 @@ static WebWindowWatcher *_windowWatcher = nil; core(_private)->setVisitCount(count); } -- (void)setViewState:(id)statePList; +- (void)setViewState:(id)statePList { core(_private)->setViewState(statePList); } @@ -422,11 +422,6 @@ static WebWindowWatcher *_windowWatcher = nil; core(_private)->visited(title, [NSDate timeIntervalSinceReferenceDate]); } -- (void)_setVisitCount:(int)count -{ - core(_private)->setVisitCount(count); -} - - (void)_recordInitialVisit { core(_private)->recordInitialVisit(); diff --git a/WebKit/mac/History/WebHistoryItemInternal.h b/WebKit/mac/History/WebHistoryItemInternal.h index 74a8074..fe2ae1a 100644 --- a/WebKit/mac/History/WebHistoryItemInternal.h +++ b/WebKit/mac/History/WebHistoryItemInternal.h @@ -52,7 +52,6 @@ extern void WKNotifyHistoryItemChanged(); - (void)_mergeAutoCompleteHints:(WebHistoryItem *)otherItem; - (void)setTitle:(NSString *)title; - (void)_visitedWithTitle:(NSString *)title; -- (void)_setVisitCount:(int)count; - (void)_recordInitialVisit; @end |