Commit 4dd0af3e authored by darin's avatar darin
Browse files

Update to use the new style of assertions.

	A few places still use the WebKitDebug.h, for logging.

        * Bookmarks.subproj/WebBookmark.m:
        * Bookmarks.subproj/WebBookmarkGroup.m:
        * Bookmarks.subproj/WebBookmarkLeaf.m:
        * Bookmarks.subproj/WebBookmarkList.m:
        * Bookmarks.subproj/WebBookmarkSeparator.m:
        * History.subproj/WebHistory.m:
        * History.subproj/WebHistoryList.m:
        * History.subproj/WebHistoryPrivate.m:
        * History.subproj/WebURLsWithTitles.m:
        * Misc.subproj/WebDownloadHandler.m:
        * Misc.subproj/WebIconDatabase.m:
        * Misc.subproj/WebIconLoader.m:
        * Misc.subproj/WebKitDebug.h:
        * Misc.subproj/WebStringTruncator.m:
        * Panels.subproj/WebAuthenticationPanel.m:
        * Plugins.subproj/WebPlugin.m:
        * Plugins.subproj/WebPluginDatabase.m:
        * Plugins.subproj/WebPluginNullEventSender.m:
        * Plugins.subproj/WebPluginStream.m:
        * Plugins.subproj/WebPluginView.m:
        * Plugins.subproj/npapi.m:
        * WebCoreSupport.subproj/WebBridge.m:
        * WebCoreSupport.subproj/WebCookieAdapter.m:
        * WebCoreSupport.subproj/WebImageRenderer.m:
        * WebCoreSupport.subproj/WebImageRendererFactory.m:
        * WebCoreSupport.subproj/WebSubresourceClient.m:
        * WebCoreSupport.subproj/WebTextRenderer.m:
        * WebCoreSupport.subproj/WebTextRendererFactory.m:
        * WebCoreSupport.subproj/WebViewFactory.m:
        * WebView.subproj/WebController.m:
        * WebView.subproj/WebControllerPrivate.m:
        * WebView.subproj/WebDataSource.m:
        * WebView.subproj/WebDataSourcePrivate.m:
        * WebView.subproj/WebDefaultPolicyHandler.m:
        * WebView.subproj/WebFrame.m:
        * WebView.subproj/WebFramePrivate.m:
        * WebView.subproj/WebHTMLView.m:
        * WebView.subproj/WebHTMLViewPrivate.m:
        * WebView.subproj/WebMainResourceClient.m:
        * WebView.subproj/WebPreferences.m:
        * WebView.subproj/WebViewPrivate.m:
	Use new assertions.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1974 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent dfe5e9d4
......@@ -13,7 +13,7 @@
#import <WebKit/WebBookmarkLeaf.h>
#import <WebKit/WebBookmarkList.h>
#import <WebKit/WebBookmarkSeparator.h>
#import <WebKit/WebKitDebug.h>
#import <WebFoundation/WebAssertions.h>
// to get NSRequestConcreteImplementation
#import <Foundation/NSPrivateDecls.h>
......@@ -36,7 +36,7 @@ - (id)init
- (void)dealloc
{
WEBKIT_ASSERT (_group == nil);
ASSERT(_group == nil);
[_identifier release];
[super dealloc];
......@@ -44,7 +44,7 @@ - (void)dealloc
- (NSString *)identifier
{
WEBKIT_ASSERT(_identifier != nil);
ASSERT(_identifier != nil);
return [[_identifier retain] autorelease];
}
......
......@@ -14,6 +14,8 @@
#import <WebKit/WebBookmarkSeparator.h>
#import <WebKit/WebKitDebug.h>
#import <WebFoundation/WebAssertions.h>
@interface WebBookmarkGroup (WebForwardDeclarations)
- (void)_setTopBookmark:(WebBookmark *)newTopBookmark;
@end
......@@ -60,7 +62,7 @@ - (void)_sendChangeNotificationForBookmark:(WebBookmark *)bookmark
{
NSDictionary *userInfo;
WEBKIT_ASSERT (bookmark != nil);
ASSERT(bookmark != nil);
if (_loading) {
return;
......@@ -79,7 +81,7 @@ - (void)_sendChangeNotificationForBookmark:(WebBookmark *)bookmark
- (void)_setTopBookmark:(WebBookmark *)newTopBookmark
{
WEBKIT_ASSERT_VALID_ARG (newTopBookmark, newTopBookmark == nil ||
ASSERT_ARG(newTopBookmark, newTopBookmark == nil ||
[newTopBookmark bookmarkType] == WebBookmarkTypeList);
[newTopBookmark retain];
......@@ -103,20 +105,20 @@ - (void)_bookmarkDidChange:(WebBookmark *)bookmark
- (void)_bookmarkChildrenDidChange:(WebBookmark *)bookmark
{
WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark bookmarkType] == WebBookmarkTypeList);
ASSERT_ARG(bookmark, [bookmark bookmarkType] == WebBookmarkTypeList);
[self _sendChangeNotificationForBookmark:bookmark childrenChanged:YES];
}
- (void)_removedBookmark:(WebBookmark *)bookmark
{
WEBKIT_ASSERT ([_bookmarksByID objectForKey:[bookmark identifier]] == bookmark);
ASSERT([_bookmarksByID objectForKey:[bookmark identifier]] == bookmark);
[_bookmarksByID removeObjectForKey:[bookmark identifier]];
}
- (void)_addedBookmark:(WebBookmark *)bookmark
{
WEBKIT_ASSERT ([_bookmarksByID objectForKey:[bookmark identifier]] == nil);
ASSERT([_bookmarksByID objectForKey:[bookmark identifier]] == nil);
[_bookmarksByID setObject:bookmark forKey:[bookmark identifier]];
}
......@@ -127,8 +129,8 @@ - (WebBookmark *)bookmarkForIdentifier:(NSString *)identifier
- (void)removeBookmark:(WebBookmark *)bookmark
{
WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark group] == self);
WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark parent] != nil || bookmark == _topBookmark);
ASSERT_ARG(bookmark, [bookmark group] == self);
ASSERT_ARG(bookmark, [bookmark parent] != nil || bookmark == _topBookmark);
if (bookmark == _topBookmark) {
[self _setTopBookmark:nil];
......@@ -158,9 +160,9 @@ - (WebBookmark *)insertNewBookmarkAtIndex:(unsigned)index
{
WebBookmark *bookmark;
WEBKIT_ASSERT_VALID_ARG (parent, [parent group] == self);
WEBKIT_ASSERT_VALID_ARG (parent, [parent bookmarkType] == WebBookmarkTypeList);
WEBKIT_ASSERT_VALID_ARG (newURLString, bookmarkType == WebBookmarkTypeLeaf || (newURLString == nil));
ASSERT_ARG(parent, [parent group] == self);
ASSERT_ARG(parent, [parent bookmarkType] == WebBookmarkTypeList);
ASSERT_ARG(newURLString, bookmarkType == WebBookmarkTypeLeaf || (newURLString == nil));
if (bookmarkType == WebBookmarkTypeLeaf) {
bookmark = [[WebBookmarkLeaf alloc] initWithURLString:newURLString
......@@ -169,7 +171,7 @@ - (WebBookmark *)insertNewBookmarkAtIndex:(unsigned)index
} else if (bookmarkType == WebBookmarkTypeSeparator) {
bookmark = [[WebBookmarkSeparator alloc] initWithGroup:self];
} else {
WEBKIT_ASSERT (bookmarkType == WebBookmarkTypeList);
ASSERT(bookmarkType == WebBookmarkTypeList);
bookmark = [[WebBookmarkList alloc] initWithTitle:newTitle
group:self];
}
......@@ -191,17 +193,17 @@ - (BOOL)_loadBookmarkGroupGuts
path = [self file];
if (path == nil) {
WEBKITDEBUG("couldn't load bookmarks; couldn't find or create directory to store it in\n");
ERROR("couldn't load bookmarks; couldn't find or create directory to store it in");
return NO;
}
dictionary = [NSDictionary dictionaryWithContentsOfFile: path];
if (dictionary == nil) {
if (![[NSFileManager defaultManager] fileExistsAtPath: path]) {
WEBKITDEBUG("no bookmarks file found at %s\n",
ERROR("no bookmarks file found at %s",
DEBUG_OBJECT(path));
} else {
WEBKITDEBUG("attempt to read bookmarks from %s failed; perhaps contents are corrupted\n",
ERROR("attempt to read bookmarks from %s failed; perhaps contents are corrupted",
DEBUG_OBJECT(path));
}
return NO;
......@@ -226,7 +228,7 @@ - (BOOL)loadBookmarkGroup
if (result == YES) {
duration = CFAbsoluteTimeGetCurrent() - start;
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "loading %d bookmarks from %s took %f seconds\n",
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "loading %d bookmarks from %s took %f seconds",
[[self topBookmark] _numberOfDescendants], DEBUG_OBJECT([self file]), duration);
}
......@@ -240,13 +242,13 @@ - (BOOL)_saveBookmarkGroupGuts
path = [self file];
if (path == nil) {
WEBKITDEBUG("couldn't save bookmarks; couldn't find or create directory to store it in\n");
ERROR("couldn't save bookmarks; couldn't find or create directory to store it in");
return NO;
}
dictionary = [[self topBookmark] dictionaryRepresentation];
if (![dictionary writeToFile:path atomically:YES]) {
WEBKITDEBUG("attempt to save %s to %s failed\n", DEBUG_OBJECT(dictionary), DEBUG_OBJECT(path));
ERROR("attempt to save %s to %s failed", DEBUG_OBJECT(dictionary), DEBUG_OBJECT(path));
return NO;
}
......@@ -263,7 +265,7 @@ - (BOOL)saveBookmarkGroup
if (result == YES) {
duration = CFAbsoluteTimeGetCurrent() - start;
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "saving %d bookmarks to %s took %f seconds\n",
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "saving %d bookmarks to %s took %f seconds",
[[self topBookmark] _numberOfDescendants], DEBUG_OBJECT([self file]), duration);
}
......
......@@ -11,7 +11,7 @@
#import <WebKit/WebBookmarkGroup.h>
#import <WebKit/WebBookmarkGroupPrivate.h>
#import <WebKit/WebHistoryItem.h>
#import <WebKit/WebKitDebug.h>
#import <WebFoundation/WebAssertions.h>
#import <WebFoundation/WebNSURLExtras.h>
......@@ -45,7 +45,7 @@ - (id)initWithURLString:(NSString *)URLString
- (id)initFromDictionaryRepresentation:(NSDictionary *)dict withGroup:(WebBookmarkGroup *)group
{
WEBKIT_ASSERT_VALID_ARG (dict, dict != nil);
ASSERT_ARG(dict, dict != nil);
[super init];
......@@ -98,7 +98,7 @@ - (void)setTitle:(NSString *)title
return;
}
WEBKIT_ASSERT (_entry != nil);
ASSERT(_entry != nil);
[_entry setTitle:title];
[[self group] _bookmarkDidChange:self];
......
......@@ -11,7 +11,7 @@
#import <WebKit/WebBookmarkSeparator.h>
#import <WebKit/WebBookmarkPrivate.h>
#import <WebKit/WebBookmarkGroupPrivate.h>
#import <WebKit/WebKitDebug.h>
#import <WebFoundation/WebAssertions.h>
#define TitleKey @"Title"
#define ChildrenKey @"Children"
......@@ -36,7 +36,7 @@ - (id)initFromDictionaryRepresentation:(NSDictionary *)dict withGroup:(WebBookma
WebBookmark *child;
unsigned index, count;
WEBKIT_ASSERT_VALID_ARG (dict, dict != nil);
ASSERT_ARG(dict, dict != nil);
[super init];
......@@ -175,8 +175,8 @@ - (unsigned)_numberOfDescendants
- (void)removeChild:(WebBookmark *)bookmark
{
WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark parent] == self);
WEBKIT_ASSERT_VALID_ARG (bookmark, [_list containsObject:bookmark]);
ASSERT_ARG(bookmark, [bookmark parent] == self);
ASSERT_ARG(bookmark, [_list containsObject:bookmark]);
[_list removeObject:bookmark];
[bookmark _setParent:nil];
......@@ -187,8 +187,8 @@ - (void)removeChild:(WebBookmark *)bookmark
- (void)insertChild:(WebBookmark *)bookmark atIndex:(unsigned)index
{
WEBKIT_ASSERT_VALID_ARG (bookmark, [bookmark parent] == nil);
WEBKIT_ASSERT_VALID_ARG (bookmark, ![_list containsObject:bookmark]);
ASSERT_ARG(bookmark, [bookmark parent] == nil);
ASSERT_ARG(bookmark, ![_list containsObject:bookmark]);
[_list insertObject:bookmark atIndex:index];
[bookmark _setParent:self];
......
......@@ -9,7 +9,7 @@
#import "WebBookmarkSeparator.h"
#import "WebBookmarkPrivate.h"
#import <WebKit/WebKitDebug.h>
#import <WebFoundation/WebAssertions.h>
@implementation WebBookmarkSeparator
......@@ -25,7 +25,7 @@ - (id)initWithGroup:(WebBookmarkGroup *)group
- (id)initFromDictionaryRepresentation:(NSDictionary *)dict withGroup:(WebBookmarkGroup *)group
{
if (![[dict objectForKey:WebBookmarkTypeKey] isEqualToString:WebBookmarkTypeSeparatorValue]) {
WEBKITDEBUG("Can't initialize Bookmark separator from non-separator type");
ERROR("Can't initialize Bookmark separator from non-separator type");
return nil;
}
......
2002-09-05 Darin Adler <darin@apple.com>
Update to use the new style of assertions.
A few places still use the WebKitDebug.h, for logging.
* Bookmarks.subproj/WebBookmark.m:
* Bookmarks.subproj/WebBookmarkGroup.m:
* Bookmarks.subproj/WebBookmarkLeaf.m:
* Bookmarks.subproj/WebBookmarkList.m:
* Bookmarks.subproj/WebBookmarkSeparator.m:
* History.subproj/WebHistory.m:
* History.subproj/WebHistoryList.m:
* History.subproj/WebHistoryPrivate.m:
* History.subproj/WebURLsWithTitles.m:
* Misc.subproj/WebDownloadHandler.m:
* Misc.subproj/WebIconDatabase.m:
* Misc.subproj/WebIconLoader.m:
* Misc.subproj/WebKitDebug.h:
* Misc.subproj/WebStringTruncator.m:
* Panels.subproj/WebAuthenticationPanel.m:
* Plugins.subproj/WebPlugin.m:
* Plugins.subproj/WebPluginDatabase.m:
* Plugins.subproj/WebPluginNullEventSender.m:
* Plugins.subproj/WebPluginStream.m:
* Plugins.subproj/WebPluginView.m:
* Plugins.subproj/npapi.m:
* WebCoreSupport.subproj/WebBridge.m:
* WebCoreSupport.subproj/WebCookieAdapter.m:
* WebCoreSupport.subproj/WebImageRenderer.m:
* WebCoreSupport.subproj/WebImageRendererFactory.m:
* WebCoreSupport.subproj/WebSubresourceClient.m:
* WebCoreSupport.subproj/WebTextRenderer.m:
* WebCoreSupport.subproj/WebTextRendererFactory.m:
* WebCoreSupport.subproj/WebViewFactory.m:
* WebView.subproj/WebController.m:
* WebView.subproj/WebControllerPrivate.m:
* WebView.subproj/WebDataSource.m:
* WebView.subproj/WebDataSourcePrivate.m:
* WebView.subproj/WebDefaultPolicyHandler.m:
* WebView.subproj/WebFrame.m:
* WebView.subproj/WebFramePrivate.m:
* WebView.subproj/WebHTMLView.m:
* WebView.subproj/WebHTMLViewPrivate.m:
* WebView.subproj/WebMainResourceClient.m:
* WebView.subproj/WebPreferences.m:
* WebView.subproj/WebViewPrivate.m:
Use new assertions.
2002-09-05 Richard Williamson (Local) <rjw@apple.com>
Removed debugging.
......@@ -23,7 +71,6 @@
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSource _startLoading:]):
Lookup post Jaguar CG SPI. Can now run and build
w/o patched CG.
......
2002-09-05 Darin Adler <darin@apple.com>
Update to use the new style of assertions.
A few places still use the WebKitDebug.h, for logging.
* Bookmarks.subproj/WebBookmark.m:
* Bookmarks.subproj/WebBookmarkGroup.m:
* Bookmarks.subproj/WebBookmarkLeaf.m:
* Bookmarks.subproj/WebBookmarkList.m:
* Bookmarks.subproj/WebBookmarkSeparator.m:
* History.subproj/WebHistory.m:
* History.subproj/WebHistoryList.m:
* History.subproj/WebHistoryPrivate.m:
* History.subproj/WebURLsWithTitles.m:
* Misc.subproj/WebDownloadHandler.m:
* Misc.subproj/WebIconDatabase.m:
* Misc.subproj/WebIconLoader.m:
* Misc.subproj/WebKitDebug.h:
* Misc.subproj/WebStringTruncator.m:
* Panels.subproj/WebAuthenticationPanel.m:
* Plugins.subproj/WebPlugin.m:
* Plugins.subproj/WebPluginDatabase.m:
* Plugins.subproj/WebPluginNullEventSender.m:
* Plugins.subproj/WebPluginStream.m:
* Plugins.subproj/WebPluginView.m:
* Plugins.subproj/npapi.m:
* WebCoreSupport.subproj/WebBridge.m:
* WebCoreSupport.subproj/WebCookieAdapter.m:
* WebCoreSupport.subproj/WebImageRenderer.m:
* WebCoreSupport.subproj/WebImageRendererFactory.m:
* WebCoreSupport.subproj/WebSubresourceClient.m:
* WebCoreSupport.subproj/WebTextRenderer.m:
* WebCoreSupport.subproj/WebTextRendererFactory.m:
* WebCoreSupport.subproj/WebViewFactory.m:
* WebView.subproj/WebController.m:
* WebView.subproj/WebControllerPrivate.m:
* WebView.subproj/WebDataSource.m:
* WebView.subproj/WebDataSourcePrivate.m:
* WebView.subproj/WebDefaultPolicyHandler.m:
* WebView.subproj/WebFrame.m:
* WebView.subproj/WebFramePrivate.m:
* WebView.subproj/WebHTMLView.m:
* WebView.subproj/WebHTMLViewPrivate.m:
* WebView.subproj/WebMainResourceClient.m:
* WebView.subproj/WebPreferences.m:
* WebView.subproj/WebViewPrivate.m:
Use new assertions.
2002-09-05 Richard Williamson (Local) <rjw@apple.com>
Removed debugging.
......@@ -23,7 +71,6 @@
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSource _startLoading:]):
Lookup post Jaguar CG SPI. Can now run and build
w/o patched CG.
......
......@@ -9,7 +9,7 @@
#import "WebHistory.h"
#import "WebHistoryPrivate.h"
#import "WebKitDebug.h"
#import <WebFoundation/WebAssertions.h>
NSString *WebHistoryEntriesChangedNotification = @"WebHistoryEntriesChangedNotification";
......@@ -19,7 +19,7 @@ + (WebHistory *)webHistoryWithFile: (NSString*)file
{
// Should only be called once. Need to rationalize usage
// of history.
WEBKIT_ASSERT ([[self class] sharedHistory] == nil);
ASSERT([[self class] sharedHistory] == nil);
WebHistory *h = [[self alloc] initWithFile:file];
[[self class] setSharedHistory: h];
......
......@@ -5,7 +5,7 @@
#import "WebHistoryList.h"
#import "WebHistoryItem.h"
#import "WebKitDebug.h"
#import <WebFoundation/WebAssertions.h>
struct WebHistoryListNode
{
......@@ -96,7 +96,7 @@ -(int)maximumSize
-(void)setMaximumSize:(int)size
{
WEBKIT_ASSERT(size > 0 || size == -1);
ASSERT(size > 0 || size == -1);
_maximumSize = size;
}
......@@ -178,7 +178,7 @@ -(WebHistoryItem *)entryForURL:(NSURL *)URL
-(WebHistoryItem *)entryAtIndex:(int)index
{
WEBKIT_ASSERT(index >= 0 && index < _count);
ASSERT(index >= 0 && index < _count);
WebHistoryListNode *node = _head;
int i;
......@@ -191,7 +191,7 @@ -(WebHistoryItem *)entryAtIndex:(int)index
-(void)replaceEntryAtIndex:(int)index withEntry:(WebHistoryItem *)entry
{
WEBKIT_ASSERT(index >= 0 && index < _count);
ASSERT(index >= 0 && index < _count);
WebHistoryListNode *node = _head;
int i;
......@@ -205,7 +205,7 @@ -(void)replaceEntryAtIndex:(int)index withEntry:(WebHistoryItem *)entry
-(WebHistoryItem *)removeEntryAtIndex:(int)index
{
WEBKIT_ASSERT(index > 0 && index < _count);
ASSERT(index > 0 && index < _count);
WebHistoryListNode *node = _head;
int i;
......@@ -238,7 +238,7 @@ -(WebHistoryItem *)removeEntryAtIndex:(int)index
-(void)removeEntriesToIndex:(int)index
{
WEBKIT_ASSERT(index > 0 && index < _count);
ASSERT(index > 0 && index < _count);
WebHistoryListNode *node = _head;
int i;
......
......@@ -8,10 +8,12 @@
#import "WebHistoryPrivate.h"
#import "WebHistoryItem.h"
#import <WebKit/WebKitDebug.h>
#import <WebFoundation/WebAssertions.h>
#import <WebFoundation/WebNSCalendarDateExtras.h>
#import <WebFoundation/WebNSURLExtras.h>
#import <WebKit/WebKitDebug.h>
#import "WebHistoryItem.h"
@interface WebHistoryPrivate (Private)
-(WebHistoryItem *)_entryForURLString:(NSString *)URLString;
......@@ -65,7 +67,7 @@ - (BOOL)findIndex: (int *)index forDay: (NSCalendarDate *)date
{
int count;
WEBKIT_ASSERT_VALID_ARG (index, index != nil);
ASSERT_ARG(index, index != nil);
//FIXME: just does linear search through days; inefficient if many days
count = [_datesWithEntries count];
......@@ -88,8 +90,8 @@ - (void)insertEntry: (WebHistoryItem *)entry atDateIndex: (int)dateIndex
NSMutableArray *entriesForDate;
NSCalendarDate *entryDate;
WEBKIT_ASSERT_VALID_ARG (entry, entry != nil);
WEBKIT_ASSERT_VALID_ARG (dateIndex, dateIndex >= 0 && (uint)dateIndex < [_entriesByDate count]);
ASSERT_ARG(entry, entry != nil);
ASSERT_ARG(dateIndex, dateIndex >= 0 && (uint)dateIndex < [_entriesByDate count]);
//FIXME: just does linear search through entries; inefficient if many entries for this date
entryDate = [entry lastVisitedDate];
......@@ -120,7 +122,7 @@ - (BOOL)removeEntryForURLString: (NSString *)URLString
foundDate = [self findIndex: &dateIndex forDay: [entry lastVisitedDate]];
WEBKIT_ASSERT (foundDate);
ASSERT(foundDate);
entriesForDate = [_entriesByDate objectAtIndex: dateIndex];
[entriesForDate removeObject: entry];
......@@ -140,7 +142,7 @@ - (void)addEntry: (WebHistoryItem *)entry
int dateIndex;
NSString *URLString;
WEBKIT_ASSERT_VALID_ARG (entry, [entry lastVisitedDate] != nil);
ASSERT_ARG(entry, [entry lastVisitedDate] != nil);
URLString = [[entry URL] absoluteString];
[self removeEntryForURLString: URLString];
......@@ -229,7 +231,7 @@ - (WebHistoryItem *)updateURL:(NSString *)newURLString
{
WebHistoryItem *entry;
WEBKIT_ASSERT (oldURLString != nil);
ASSERT(oldURLString != nil);
entry = [self _entryForURLString:oldURLString];
if (entry == nil) {
......@@ -369,17 +371,17 @@ - (BOOL)_loadHistoryGuts: (int *)numberOfItemsLoaded
path = [self file];
if (path == nil) {
WEBKITDEBUG("couldn't load history; couldn't find or create directory to store it in\n");
ERROR("couldn't load history; couldn't find or create directory to store it in");
return NO;
}
array = [NSArray arrayWithContentsOfFile: path];
if (array == nil) {
if (![[NSFileManager defaultManager] fileExistsAtPath: path]) {
WEBKITDEBUG("no history file found at %s\n",
ERROR("no history file found at %s",
DEBUG_OBJECT(path));
} else {
WEBKITDEBUG("attempt to read history from %s failed; perhaps contents are corrupted\n",
ERROR("attempt to read history from %s failed; perhaps contents are corrupted",
DEBUG_OBJECT(path));
}
return NO;
......@@ -432,7 +434,7 @@ - (BOOL)loadHistory
if (result) {
duration = CFAbsoluteTimeGetCurrent() - start;
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "loading %d history entries from %s took %f seconds\n",
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "loading %d history entries from %s took %f seconds",
numberOfItems, DEBUG_OBJECT([self file]), duration);
}
......@@ -447,13 +449,13 @@ - (BOOL)_saveHistoryGuts: (int *)numberOfItemsSaved
path = [self file];
if (path == nil) {
WEBKITDEBUG("couldn't save history; couldn't find or create directory to store it in\n");
ERROR("couldn't save history; couldn't find or create directory to store it in");
return NO;
}
array = [self arrayRepresentation];
if (![array writeToFile:path atomically:YES]) {
WEBKITDEBUG("attempt to save %s to %s failed\n", DEBUG_OBJECT(array), DEBUG_OBJECT(path));
ERROR("attempt to save %s to %s failed", DEBUG_OBJECT(array), DEBUG_OBJECT(path));
return NO;
}
......@@ -472,7 +474,7 @@ - (BOOL)saveHistory
if (result) {
duration = CFAbsoluteTimeGetCurrent() - start;
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "saving %d history entries to %s took %f seconds\n",
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "saving %d history entries to %s took %f seconds",
numberOfItems, DEBUG_OBJECT([self file]), duration);
}
......
......@@ -7,7 +7,7 @@
//
#import "WebURLsWithTitles.h"
#import <WebKit/WebKitDebug.h>
#import <WebFoundation/WebAssertions.h>
#import <WebFoundation/WebNSURLExtras.h>
......
......@@ -6,11 +6,14 @@
// Copyright (c) 2002 Apple Computer, Inc.
//
#import <WebKit/WebControllerPolicyHandlerPrivate.h>
#import <WebKit/WebDownloadHandler.h>
#import <WebKit/WebControllerPolicyHandlerPrivate.h>
#import <WebKit/WebDataSourcePrivate.h>
#import <WebKit/WebKitDebug.h>
#import <WebFoundation/WebAssertions.h>
@implementation WebDownloadHandler
- initWithDataSource:(WebDataSource *)dSource
......
......@@ -6,10 +6,12 @@
// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
//
#import <WebKit/WebKitDebug.h>
#import <WebKit/WebIconDatabase.h>
#import <WebKit/WebIconDatabasePrivate.h>
#import <WebKit/WebKitDebug.h>
#import <WebFoundation/WebAssertions.h>
#import <WebFoundation/WebNSURLExtras.h>
#import <WebFoundation/WebFileDatabase.h>
......@@ -365,7 +367,7 @@ - (NSMutableArray *)_iconsForIconURL:(NSURL *)iconURL
NSImage *icon = [[NSImage alloc] initWithData:iconData];
if(icon){
duration = CFAbsoluteTimeGetCurrent() - start;
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "loading and creating icon %s took %f seconds\n",
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "loading and creating icon %s took %f seconds",
DEBUG_OBJECT(iconURL), duration);
// Cache it
......@@ -729,7 +731,7 @@ - (NSImage *)_iconByScalingIcon:(NSImage *)icon toSize:(NSSize)size
#endif
duration = CFAbsoluteTimeGetCurrent() - start;
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "scaling icon took %f seconds.\n", duration);
WEBKITDEBUGLEVEL (WEBKIT_LOG_TIMING, "scaling icon took %f seconds.", duration);
return scaledIcon;
}
......
......@@ -6,7 +6,7 @@
// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
//
#import <WebKit/WebKitDebug.h>
#import <WebFoundation/WebAssertions.h>
#import <WebKit/WebIconDatabase.h></