[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:32:00 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit c853985f4f01e0981c227eb7d227ba5990fb4af3
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Mar 27 21:45:29 2003 +0000
WebKit:
API change: WebHistory initWithFile: -> initWithContentsOfURL:
Reviewed by Ken.
* History.subproj/WebHistory.h:
* History.subproj/WebHistory.m:
(-[WebHistory initWithContentsOfURL:]):
(-[WebHistory URL]):
* History.subproj/WebHistoryPrivate.h:
* History.subproj/WebHistoryPrivate.m:
(-[WebHistoryPrivate initWithContentsOfURL:]):
(-[WebHistoryPrivate dealloc]):
(-[WebHistoryPrivate _loadHistoryGuts:]):
(-[WebHistoryPrivate loadHistory]):
(-[WebHistoryPrivate _saveHistoryGuts:]):
(-[WebHistoryPrivate URL]):
(-[WebHistoryPrivate saveHistory]):
WebBrowser:
API change: WebHistory initWithFile: -> initWithContentsOfURL:
Reviewed by Ken.
* Debug/DebugUtilities.m:
(-[WebHistory populateHistoryWithTestData:]):
* GlobalHistory.m:
(-[GlobalHistory init]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 6b9799d..ef40c55 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,23 @@
+2003-03-27 Richard Williamson <rjw at apple.com>
+
+ API change: WebHistory initWithFile: -> initWithContentsOfURL:
+
+ Reviewed by Ken.
+
+ * History.subproj/WebHistory.h:
+ * History.subproj/WebHistory.m:
+ (-[WebHistory initWithContentsOfURL:]):
+ (-[WebHistory URL]):
+ * History.subproj/WebHistoryPrivate.h:
+ * History.subproj/WebHistoryPrivate.m:
+ (-[WebHistoryPrivate initWithContentsOfURL:]):
+ (-[WebHistoryPrivate dealloc]):
+ (-[WebHistoryPrivate _loadHistoryGuts:]):
+ (-[WebHistoryPrivate loadHistory]):
+ (-[WebHistoryPrivate _saveHistoryGuts:]):
+ (-[WebHistoryPrivate URL]):
+ (-[WebHistoryPrivate saveHistory]):
+
2003-03-27 Darin Adler <darin at apple.com>
Reviewed by Shelley.
diff --git a/WebKit/History.subproj/WebHistory.h b/WebKit/History.subproj/WebHistory.h
index 34c7578..80e4372 100644
--- a/WebKit/History.subproj/WebHistory.h
+++ b/WebKit/History.subproj/WebHistory.h
@@ -41,17 +41,18 @@ extern NSString *WebHistoryLoadedNotification;
/*!
@method createSharedHistoryWithFile:
- @param file The file to use to initialize the WebHistory.
+ @param history The history to use for the global WebHistory.
@result Returns a WebHistory initialized with the contents of file.
*/
-+ (void)setSharedHistory:(WebHistory *)file;
++ (void)setSharedHistory:(WebHistory *)history;
/*!
- @method initWithFile:
+ @method initWithContentsOfURL:
+ @param URL The URL to use to initialize the WebHistory.
@abstract The designated initializer for WebHistory.
@result Returns an initialized WebHistory.
*/
-- initWithFile:(NSString *)file;
+- initWithContentsOfURL:(NSURL *)URL;
/*!
@method addEntries:
@@ -109,7 +110,7 @@ extern NSString *WebHistoryLoadedNotification;
@discussion The file path used for storing history, specified in -[WebHistory initWithFile:] or +[WebHistory webHistoryWithFile:]
@result Returns the file path used to store the history.
*/
-- (NSString *)file;
+- (NSURL *)URL;
/*!
@method loadHistory
diff --git a/WebKit/History.subproj/WebHistory.m b/WebKit/History.subproj/WebHistory.m
index 8e8a3a6..1e1e1de 100644
--- a/WebKit/History.subproj/WebHistory.m
+++ b/WebKit/History.subproj/WebHistory.m
@@ -69,10 +69,10 @@ static WebHistory *_sharedHistory = nil;
}
}
-- (id)initWithFile: (NSString *)file;
+- (id)initWithContentsOfURL: (NSURL *)URL
{
if ((self = [super init]) != nil) {
- _historyPrivate = [[WebHistoryPrivate alloc] initWithFile:file];
+ _historyPrivate = [[WebHistoryPrivate alloc] initWithContentsOfURL:URL];
}
return self;
@@ -172,9 +172,9 @@ static WebHistory *_sharedHistory = nil;
#pragma mark SAVING TO DISK
-- (NSString *)file
+- (NSURL *)URL
{
- return [_historyPrivate file];
+ return [_historyPrivate URL];
}
- (BOOL)loadHistory
diff --git a/WebKit/History.subproj/WebHistoryPrivate.h b/WebKit/History.subproj/WebHistoryPrivate.h
index f12960f..16b7cf1 100644
--- a/WebKit/History.subproj/WebHistoryPrivate.h
+++ b/WebKit/History.subproj/WebHistoryPrivate.h
@@ -17,10 +17,10 @@
NSMutableDictionary *_entriesByURL;
NSMutableArray *_datesWithEntries;
NSMutableArray *_entriesByDate;
- NSString *_file;
+ NSURL *_URL;
}
-- (id)initWithFile: (NSString *)file;
+- (id)initWithContentsOfURL: (NSURL *)URL;
- (void)addItem: (WebHistoryItem *)entry;
- (void)addItems:(NSArray *)newEntries;
@@ -34,7 +34,7 @@
- (BOOL)containsURL: (NSURL *)URL;
- (WebHistoryItem *)itemForURL:(NSURL *)URL;
-- (NSString *)file;
+- (NSURL *)URL;
- (BOOL)loadHistory;
- (BOOL)saveHistory;
diff --git a/WebKit/History.subproj/WebHistoryPrivate.m b/WebKit/History.subproj/WebHistoryPrivate.m
index e98315f..61d35bb 100644
--- a/WebKit/History.subproj/WebHistoryPrivate.m
+++ b/WebKit/History.subproj/WebHistoryPrivate.m
@@ -35,7 +35,7 @@
nil]];
}
-- (id)initWithFile: (NSString *)file
+- (id)initWithContentsOfURL: (NSURL *)URL
{
if (![super init]) {
return nil;
@@ -44,7 +44,7 @@
_entriesByURL = [[NSMutableDictionary alloc] init];
_datesWithEntries = [[NSMutableArray alloc] init];
_entriesByDate = [[NSMutableArray alloc] init];
- _file = [file retain];
+ _URL = [URL retain];
// read history from disk
[self loadHistory];
@@ -57,7 +57,7 @@
[_entriesByURL release];
[_datesWithEntries release];
[_entriesByDate release];
- [_file release];
+ [_URL release];
[super dealloc];
}
@@ -338,14 +338,8 @@
return arrayRep;
}
-- (NSString *)file
-{
- return _file;
-}
-
- (BOOL)_loadHistoryGuts: (int *)numberOfItemsLoaded
{
- NSString *path;
NSArray *array;
NSEnumerator *enumerator;
NSDictionary *dictionary;
@@ -356,17 +350,9 @@
*numberOfItemsLoaded = 0;
- path = [self file];
- if (path == nil) {
- ERROR("couldn't load history; couldn't find or create directory to store it in");
- return NO;
- }
-
- array = [NSArray arrayWithContentsOfFile: path];
+ array = [NSArray arrayWithContentsOfURL: [self URL]];
if (array == nil) {
- if ([[NSFileManager defaultManager] fileExistsAtPath: path]) {
- ERROR("attempt to read history from %@ failed; perhaps contents are corrupted", path);
- } // else file doesn't exist, which is a normal initial state, so don't spam
+ ERROR("attempt to read history from %@ failed; perhaps contents are corrupted", [[self URL] absoluteString]);
return NO;
}
@@ -418,7 +404,7 @@
if (result) {
duration = CFAbsoluteTimeGetCurrent() - start;
LOG(Timing, "loading %d history entries from %@ took %f seconds",
- numberOfItems, [self file], duration);
+ numberOfItems, [[self URL] absoluteString], duration);
}
return result;
@@ -426,19 +412,12 @@
- (BOOL)_saveHistoryGuts: (int *)numberOfItemsSaved
{
- NSString *path;
NSArray *array;
*numberOfItemsSaved = 0;
- path = [self file];
- if (path == nil) {
- 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]) {
- ERROR("attempt to save %@ to %@ failed", array, path);
+ if (![array writeToURL:[self URL] atomically:YES]) {
+ ERROR("attempt to save %@ to %@ failed", array, [[self URL] absoluteString]);
return NO;
}
@@ -446,6 +425,12 @@
return YES;
}
+- (NSURL *)URL
+{
+ return _URL;
+}
+
+
- (BOOL)saveHistory
{
int numberOfItems;
@@ -458,7 +443,7 @@
if (result) {
duration = CFAbsoluteTimeGetCurrent() - start;
LOG(Timing, "saving %d history entries to %@ took %f seconds",
- numberOfItems, [self file], duration);
+ numberOfItems, [[self URL] absoluteString], duration);
}
return result;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list