Changeset 39845 in webkit
- Timestamp:
- Jan 12, 2009 4:15:14 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r39843 r39845 1 2009-01-12 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Darin Adler 4 5 <rdar://problem/6468274> - Track Non-get requests in global history 6 7 * WebCore.base.exp: 8 9 * history/HistoryItem.cpp: 10 (WebCore::HistoryItem::HistoryItem): 11 * history/HistoryItem.h: 12 (WebCore::HistoryItem::lastVisitWasHTTPNonGet): 13 (WebCore::HistoryItem::setLastVisitWasHTTPNonGet): 14 1 15 2009-01-12 Kevin Ollivier <kevino@theolliviers.com> 2 16 -
trunk/WebCore/WebCore.base.exp
r39823 r39845 131 131 __ZN7WebCore10ScrollView17setScrollbarModesENS_13ScrollbarModeES1_ 132 132 __ZN7WebCore10ScrollView20setCanHaveScrollbarsEb 133 __ZN K7WebCore10ScrollView18visibleContentRectEb133 __ZN7WebCore10StringImpl11reverseFindEPS0_ib 134 134 __ZN7WebCore10StringImpl7replaceEtt 135 135 __ZN7WebCore10StringImpl8endsWithEPS0_b … … 621 621 __ZN7WebCore8parseURLERKNS_6StringE 622 622 __ZN7WebCore9FloatRectC1ERK7_NSRect 623 __ZN7WebCore9fontCacheEv624 623 __ZN7WebCore9FontCache13fontDataCountEv 625 624 __ZN7WebCore9FontCache21inactiveFontDataCountEv … … 685 684 __ZN7WebCore9TimerBaseC2Ev 686 685 __ZN7WebCore9TimerBaseD2Ev 686 __ZN7WebCore9fontCacheEv 687 687 __ZN7WebCore9makeRangeERKNS_15VisiblePositionES2_ 688 688 __ZN7WebCore9pageCacheEv … … 695 695 __ZNK7WebCore10ScrollView12documentViewEv 696 696 __ZNK7WebCore10ScrollView14scrollbarModesERNS_13ScrollbarModeES2_ 697 __ZNK7WebCore10ScrollView18visibleContentRectEb 697 698 __ZNK7WebCore11CachedImage5imageEv 698 699 __ZNK7WebCore11ContextMenu19platformDescriptionEv … … 788 789 __ZNK7WebCore19InspectorController17drawNodeHighlightERNS_15GraphicsContextE 789 790 __ZNK7WebCore19InspectorController7enabledEv 791 __ZNK7WebCore19ResourceRequestBase10httpMethodEv 790 792 __ZNK7WebCore19ResourceRequestBase3urlEv 791 793 __ZNK7WebCore19ResourceRequestBase7isEmptyEv -
trunk/WebCore/history/HistoryItem.cpp
r38449 r39845 45 45 HistoryItem::HistoryItem() 46 46 : m_lastVisitedTime(0) 47 , m_lastVisitWasHTTPNonGet(false) 47 48 , m_lastVisitWasFailure(false) 48 49 , m_isInPageCache(false) … … 57 58 , m_title(title) 58 59 , m_lastVisitedTime(time) 60 , m_lastVisitWasHTTPNonGet(false) 59 61 , m_lastVisitWasFailure(false) 60 62 , m_isInPageCache(false) … … 71 73 , m_displayTitle(alternateTitle) 72 74 , m_lastVisitedTime(time) 75 , m_lastVisitWasHTTPNonGet(false) 73 76 , m_lastVisitWasFailure(false) 74 77 , m_isInPageCache(false) … … 86 89 , m_title(title) 87 90 , m_lastVisitedTime(0) 91 , m_lastVisitWasHTTPNonGet(false) 88 92 , m_lastVisitWasFailure(false) 89 93 , m_isInPageCache(false) … … 109 113 , m_displayTitle(item.m_displayTitle) 110 114 , m_lastVisitedTime(item.m_lastVisitedTime) 115 , m_lastVisitWasHTTPNonGet(item.m_lastVisitWasHTTPNonGet) 111 116 , m_scrollPoint(item.m_scrollPoint) 112 117 , m_lastVisitWasFailure(item.m_lastVisitWasFailure) -
trunk/WebCore/history/HistoryItem.h
r38449 r39845 102 102 int visitCount() const; 103 103 bool lastVisitWasFailure() const { return m_lastVisitWasFailure; } 104 bool lastVisitWasHTTPNonGet() const { return m_lastVisitWasHTTPNonGet; } 104 105 105 106 void mergeAutoCompleteHints(HistoryItem* otherItem); … … 125 126 void setVisitCount(int); 126 127 void setLastVisitWasFailure(bool wasFailure) { m_lastVisitWasFailure = wasFailure; } 128 void setLastVisitWasHTTPNonGet(bool wasNotGet) { m_lastVisitWasHTTPNonGet = wasNotGet; } 127 129 128 130 void addChildItem(PassRefPtr<HistoryItem>); … … 176 178 177 179 double m_lastVisitedTime; 180 bool m_lastVisitWasHTTPNonGet; 178 181 179 182 IntPoint m_scrollPoint; -
trunk/WebKit/mac/ChangeLog
r39840 r39845 1 2009-01-12 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Darin Adler 4 5 <rdar://problem/6468274> - Track Non-get requests in global history 6 7 * History/WebHistory.mm: 8 (-[WebHistory _visitedURL:withTitle:method:wasFailure:]): 9 * History/WebHistoryInternal.h: 10 11 * History/WebHistoryItem.mm: 12 (-[WebHistoryItem initFromDictionaryRepresentation:]): 13 (-[WebHistoryItem dictionaryRepresentation]): 14 (-[WebHistoryItem _lastVisitWasHTTPNonGet]): 15 * History/WebHistoryItemPrivate.h: 16 17 * WebCoreSupport/WebFrameLoaderClient.mm: 18 (WebFrameLoaderClient::updateGlobalHistory): Only pass the method through if it was an HTTP load 19 1 20 2009-01-12 Anders Carlsson <andersca@apple.com> 2 21 -
trunk/WebKit/mac/History/WebHistory.mm
r39481 r39845 795 795 @implementation WebHistory (WebInternal) 796 796 797 - (void)_visitedURL:(NSURL *)URL withTitle:(NSString *)title wasFailure:(BOOL)wasFailure797 - (void)_visitedURL:(NSURL *)URL withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure 798 798 { 799 799 WebHistoryItem *entry = [_historyPrivate visitedURL:URL withTitle:title]; 800 core(entry)->setLastVisitWasFailure(wasFailure); 800 HistoryItem* item = core(entry); 801 item->setLastVisitWasFailure(wasFailure); 802 if ([method length] && [method caseInsensitiveCompare:@"GET"]) 803 item->setLastVisitWasHTTPNonGet(true); 801 804 802 805 NSArray *entries = [[NSArray alloc] initWithObjects:entry, nil]; -
trunk/WebKit/mac/History/WebHistoryInternal.h
r38728 r39845 34 34 35 35 @interface WebHistory (WebInternal) 36 - (void)_visitedURL:(NSURL *)URL withTitle:(NSString *)title wasFailure:(BOOL)wasFailure;36 - (void)_visitedURL:(NSURL *)URL withTitle:(NSString *)title method:(NSString *)method wasFailure:(BOOL)wasFailure; 37 37 - (void)_addVisitedLinksToPageGroup:(WebCore::PageGroup&)group; 38 38 @end -
trunk/WebKit/mac/History/WebHistoryItem.mm
r39636 r39845 57 57 // Private keys used in the WebHistoryItem's dictionary representation. 58 58 // see 3245793 for explanation of "lastVisitedDate" 59 static NSString * WebLastVisitedTimeIntervalKey = @"lastVisitedDate";60 static NSString * WebVisitCountKey = @"visitCount";61 static NSString * WebTitleKey = @"title";62 static NSString * WebChildrenKey = @"children";63 static NSString * WebDisplayTitleKey = @"displayTitle";59 static NSString *lastVisitedTimeIntervalKey = @"lastVisitedDate"; 60 static NSString *visitCountKey = @"visitCount"; 61 static NSString *titleKey = @"title"; 62 static NSString *childrenKey = @"children"; 63 static NSString *displayTitleKey = @"displayTitle"; 64 64 static NSString *lastVisitWasFailureKey = @"lastVisitWasFailure"; 65 static NSString *lastVisitWasHTTPNonGetKey = @"lastVisitWasHTTPNonGet"; 65 66 66 67 // Notification strings. … … 336 337 ASSERT_MAIN_THREAD(); 337 338 NSString *URLString = [dict _webkit_stringForKey:@""]; 338 NSString *title = [dict _webkit_stringForKey: WebTitleKey];339 NSString *title = [dict _webkit_stringForKey:titleKey]; 339 340 340 341 // Do an existence check to avoid calling doubleValue on a nil string. Leave 341 342 // time interval at 0 if there's no value in dict. 342 NSString *timeIntervalString = [dict _webkit_stringForKey: WebLastVisitedTimeIntervalKey];343 NSString *timeIntervalString = [dict _webkit_stringForKey:lastVisitedTimeIntervalKey]; 343 344 NSTimeInterval lastVisited = timeIntervalString == nil ? 0 : [timeIntervalString doubleValue]; 344 345 345 self = [self initWithURLString:URLString title:title displayTitle:[dict _webkit_stringForKey: WebDisplayTitleKey] lastVisitedTimeInterval:lastVisited];346 self = [self initWithURLString:URLString title:title displayTitle:[dict _webkit_stringForKey:displayTitleKey] lastVisitedTimeInterval:lastVisited]; 346 347 347 348 // Check if we've read a broken URL from the file that has non-Latin1 chars. If so, try to convert … … 355 356 } 356 357 357 core(_private)->setVisitCount([dict _webkit_intForKey: WebVisitCountKey]);358 core(_private)->setVisitCount([dict _webkit_intForKey:visitCountKey]); 358 359 359 360 if ([dict _webkit_boolForKey:lastVisitWasFailureKey]) 360 361 core(_private)->setLastVisitWasFailure(true); 361 362 NSArray *childDicts = [dict objectForKey:WebChildrenKey]; 362 363 BOOL lastVisitWasHTTPNonGet = [dict _webkit_boolForKey:lastVisitWasHTTPNonGetKey]; 364 NSString *tempURLString = [URLString lowercaseString]; 365 if (lastVisitWasHTTPNonGet && ([tempURLString hasPrefix:@"http:"] || [tempURLString hasPrefix:@"https:"])) 366 core(_private)->setLastVisitWasHTTPNonGet(lastVisitWasHTTPNonGet); 367 368 NSArray *childDicts = [dict objectForKey:childrenKey]; 363 369 if (childDicts) { 364 370 for (int i = [childDicts count] - 1; i >= 0; i--) { … … 408 414 } 409 415 if (!coreItem->title().isEmpty()) { 410 [dict setObject:(NSString*)coreItem->title() forKey: WebTitleKey];416 [dict setObject:(NSString*)coreItem->title() forKey:titleKey]; 411 417 } 412 418 if (!coreItem->alternateTitle().isEmpty()) { 413 [dict setObject:(NSString*)coreItem->alternateTitle() forKey: WebDisplayTitleKey];419 [dict setObject:(NSString*)coreItem->alternateTitle() forKey:displayTitleKey]; 414 420 } 415 421 if (coreItem->lastVisitedTime() != 0.0) { 416 422 // store as a string to maintain backward compatibility (see 3245793) 417 423 [dict setObject:[NSString stringWithFormat:@"%.1lf", coreItem->lastVisitedTime()] 418 forKey: WebLastVisitedTimeIntervalKey];424 forKey:lastVisitedTimeIntervalKey]; 419 425 } 420 426 if (coreItem->visitCount()) 421 [dict setObject:[NSNumber numberWithInt:coreItem->visitCount()] forKey: WebVisitCountKey];427 [dict setObject:[NSNumber numberWithInt:coreItem->visitCount()] forKey:visitCountKey]; 422 428 if (coreItem->lastVisitWasFailure()) 423 429 [dict setObject:[NSNumber numberWithBool:YES] forKey:lastVisitWasFailureKey]; 430 431 if (coreItem->lastVisitWasHTTPNonGet()) { 432 ASSERT(coreItem->urlString().startsWith("http:", false) || coreItem->urlString().startsWith("https:", false)); 433 [dict setObject:[NSNumber numberWithBool:YES] forKey:lastVisitWasHTTPNonGetKey]; 434 } 435 424 436 if (coreItem->children().size()) { 425 437 const HistoryItemVector& children = coreItem->children(); … … 428 440 for (int i = children.size() - 1; i >= 0; i--) 429 441 [childDicts addObject:[kit(children[i].get()) dictionaryRepresentation]]; 430 [dict setObject: childDicts forKey: WebChildrenKey];442 [dict setObject: childDicts forKey:childrenKey]; 431 443 } 432 444 … … 540 552 } 541 553 554 - (BOOL)_lastVisitWasHTTPNonGet 555 { 556 return core(_private)->lastVisitWasHTTPNonGet(); 557 } 558 542 559 @end 543 560 -
trunk/WebKit/mac/History/WebHistoryItemPrivate.h
r39636 r39845 40 40 - (void)_setLastVisitWasFailure:(BOOL)failure; 41 41 42 - (BOOL)_lastVisitWasHTTPNonGet; 43 42 44 - (NSString *)RSSFeedReferrer; 43 45 - (void)setRSSFeedReferrer:(NSString *)referrer; -
trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
r39566 r39845 790 790 const String& title = loader->title(); 791 791 bool wasFailure = loader->urlForHistoryReflectsFailure(); 792 [[WebHistory optionalSharedHistory] _visitedURL:url withTitle:title wasFailure:wasFailure];792 [[WebHistory optionalSharedHistory] _visitedURL:url withTitle:title method:loader->request().httpMethod() wasFailure:wasFailure]; 793 793 } 794 794 -
trunk/WebKit/win/ChangeLog
r39823 r39845 1 2009-01-12 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Darin Adler 4 5 <rdar://problem/6468274> - Track Non-get requests in global history 6 7 * WebCoreSupport/WebFrameLoaderClient.cpp: 8 (WebFrameLoaderClient::updateGlobalHistory): 9 10 * WebHistory.cpp: 11 (WebHistory::addItem): 12 * WebHistory.h: 13 14 * Interfaces/IWebHistoryItemPrivate.idl: 15 * WebHistoryItem.cpp: 16 (WebHistoryItem::initFromDictionaryRepresentation): 17 (WebHistoryItem::dictionaryRepresentation): 18 (WebHistoryItem::lastVisitWasHTTPNonGet): 19 (WebHistoryItem::setLastVisitWasHTTPNonGet): 20 * WebHistoryItem.h: 21 1 22 2009-01-12 Julien Chaffraix <jchaffraix@pleyo.com> 2 23 -
trunk/WebKit/win/Interfaces/IWebHistoryItemPrivate.idl
r38728 r39845 58 58 HRESULT lastVisitWasFailure([out, retval] BOOL* wasFailure); 59 59 HRESULT setLastVisitWasFailure([in] BOOL wasFailure); 60 HRESULT lastVisitWasHTTPNonGet([out, retval] BOOL* HTTPNonGet); 60 61 } -
trunk/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
r39763 r39845 457 457 return; 458 458 DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader(); 459 history->addItem(loader->urlForHistory(), loader->title(), loader-> urlForHistoryReflectsFailure());459 history->addItem(loader->urlForHistory(), loader->title(), loader->request().httpMethod(), loader->urlForHistoryReflectsFailure()); 460 460 } 461 461 -
trunk/WebKit/win/WebHistory.cpp
r39425 r39845 669 669 } 670 670 671 void WebHistory::addItem(const KURL& url, const String& title, bool wasFailure)671 void WebHistory::addItem(const KURL& url, const String& title, const String& httpMethod, bool wasFailure) 672 672 { 673 673 COMPtr<WebHistoryItem> item(AdoptCOM, WebHistoryItem::createInstance()); … … 691 691 if (wasFailure) 692 692 item->setLastVisitWasFailure(true); 693 694 if (!httpMethod.isEmpty() && !equalIgnoringCase(httpMethod, "GET")) 695 item->setLastVisitWasHTTPNonGet(true); 693 696 694 697 addItem(item.get()); -
trunk/WebKit/win/WebHistory.h
r39425 r39845 116 116 // WebHistory 117 117 static WebHistory* sharedHistory(); 118 void addItem(const WebCore::KURL&, const WebCore::String& title, bool wasFailure);118 void addItem(const WebCore::KURL&, const WebCore::String& title, const WebCore::String& httpMethod, bool wasFailure); 119 119 void addVisitedLinksToPageGroup(WebCore::PageGroup&); 120 120 -
trunk/WebKit/win/WebHistoryItem.cpp
r38728 r39845 35 35 #include <WebCore/BString.h> 36 36 #include <WebCore/HistoryItem.h> 37 #include <WebCore/KURL.h> 37 38 #pragma warning(pop) 38 39 … … 96 97 static CFStringRef visitCountKey = CFSTR("visitCount"); 97 98 static CFStringRef lastVisitWasFailureKey = CFSTR("lastVisitWasFailure"); 99 static CFStringRef lastVisitWasHTTPNonGetKey = CFSTR("lastVisitWasHTTPNonGet"); 98 100 99 101 HRESULT STDMETHODCALLTYPE WebHistoryItem::initFromDictionaryRepresentation(void* dictionary) … … 125 127 return E_FAIL; 126 128 bool lastVisitWasFailure = lastVisitWasFailureRef && CFBooleanGetValue(lastVisitWasFailureRef); 129 130 CFBooleanRef lastVisitWasHTTPNonGetRef = static_cast<CFBooleanRef>(CFDictionaryGetValue(dictionaryRef, lastVisitWasHTTPNonGetKey)); 131 if (lastVisitWasHTTPNonGetRef && CFGetTypeID(lastVisitWasHTTPNonGetRef) != CFBooleanGetTypeID()) 132 return E_FAIL; 133 bool lastVisitWasHTTPNonGet = lastVisitWasHTTPNonGetRef && CFBooleanGetValue(lastVisitWasHTTPNonGetRef); 127 134 128 135 historyItemWrappers().remove(m_historyItem.get()); … … 133 140 if (lastVisitWasFailure) 134 141 m_historyItem->setLastVisitWasFailure(true); 142 143 if (lastVisitWasHTTPNonGet && (protocolIs(m_historyItem->urlString(), "http") || protocolIs(m_historyItem->urlString(), "https"))) 144 m_historyItem->setLastVisitWasHTTPNonGet(true); 135 145 136 146 return S_OK; … … 147 157 148 158 int keyCount = 0; 149 CFTypeRef keys[ 5];150 CFTypeRef values[ 5];159 CFTypeRef keys[6]; 160 CFTypeRef values[6]; 151 161 152 162 if (!m_historyItem->urlString().isEmpty()) { … … 169 179 if (m_historyItem->lastVisitWasFailure()) { 170 180 keys[keyCount] = lastVisitWasFailureKey; 181 values[keyCount++] = CFRetain(kCFBooleanTrue); 182 } 183 184 if (m_historyItem->lastVisitWasHTTPNonGet()) { 185 ASSERT(m_historyItem->urlString().startsWith("http:", false) || m_historyItem->urlString().startsWith("https:", false)); 186 keys[keyCount] = lastVisitWasHTTPNonGetKey; 171 187 values[keyCount++] = CFRetain(kCFBooleanTrue); 172 188 } … … 336 352 { 337 353 m_historyItem->setLastVisitWasFailure(wasFailure); 354 return S_OK; 355 } 356 357 HRESULT STDMETHODCALLTYPE WebHistoryItem::lastVisitWasHTTPNonGet(BOOL* HTTPNonGet) 358 { 359 if (!HTTPNonGet) { 360 ASSERT_NOT_REACHED(); 361 return E_POINTER; 362 } 363 364 *HTTPNonGet = m_historyItem->lastVisitWasHTTPNonGet(); 365 366 return S_OK; 367 } 368 369 HRESULT STDMETHODCALLTYPE WebHistoryItem::setLastVisitWasHTTPNonGet(BOOL HTTPNonGet) 370 { 371 m_historyItem->setLastVisitWasHTTPNonGet(HTTPNonGet); 338 372 return S_OK; 339 373 } -
trunk/WebKit/win/WebHistoryItem.h
r38728 r39845 100 100 virtual HRESULT STDMETHODCALLTYPE lastVisitWasFailure(BOOL* wasFailure); 101 101 virtual HRESULT STDMETHODCALLTYPE setLastVisitWasFailure(BOOL wasFailure); 102 virtual HRESULT STDMETHODCALLTYPE lastVisitWasHTTPNonGet(BOOL* HTTPNonGet); 103 virtual HRESULT STDMETHODCALLTYPE setLastVisitWasHTTPNonGet(BOOL HTTPNonGet); 102 104 103 105 // WebHistoryItem
Note: See TracChangeset
for help on using the changeset viewer.