2006-05-17 bradeeoh <beidson@apple.com>
authorbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 May 2006 23:45:54 +0000 (23:45 +0000)
committerbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 May 2006 23:45:54 +0000 (23:45 +0000)
        Reviewed by Tim Hatcher

        Consolidated WebDatabase base class into WebFileDatabase as the inheritance relationship became
        obsolete.  This improves readability and sets the stage for a further in-depth rewrite of the
        WebIcon* code.

        * Misc/WebDatabase.h: Removed.
        * Misc/WebDatabase.m: Removed.
        * Misc/WebFileDatabase.h:
        * Misc/WebFileDatabase.m:
        (-[WebFileDatabaseOp dealloc]):
        (-[WebFileDatabase dealloc]):
        (-[WebFileDatabase path]):
        (-[WebFileDatabase isOpen]):
        (-[WebFileDatabase sizeLimit]):
        * WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14452 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/Misc/WebDatabase.h [deleted file]
WebKit/Misc/WebDatabase.m [deleted file]
WebKit/Misc/WebFileDatabase.h
WebKit/Misc/WebFileDatabase.m
WebKit/WebKit.xcodeproj/project.pbxproj

index fa6197240e7e3adf1fd189157a48b136e727fb2e..703ca446e1bc31ed2db01f540dd3818dd12d3815 100644 (file)
@@ -1,3 +1,22 @@
+2006-05-17  bradeeoh  <beidson@apple.com>
+
+        Reviewed by Tim Hatcher
+
+        Consolidated WebDatabase base class into WebFileDatabase as the inheritance relationship became 
+        obsolete.  This improves readability and sets the stage for a further in-depth rewrite of the 
+        WebIcon* code.
+
+        * Misc/WebDatabase.h: Removed.
+        * Misc/WebDatabase.m: Removed.
+        * Misc/WebFileDatabase.h:
+        * Misc/WebFileDatabase.m:
+        (-[WebFileDatabaseOp dealloc]): 
+        (-[WebFileDatabase dealloc]):  
+        (-[WebFileDatabase path]):
+        (-[WebFileDatabase isOpen]):
+        (-[WebFileDatabase sizeLimit]):
+        * WebKit.xcodeproj/project.pbxproj:
+
 2006-05-17  Adele Peterson  <adele@apple.com>
 
         Reviewed by Hyatt.
diff --git a/WebKit/Misc/WebDatabase.h b/WebKit/Misc/WebDatabase.h
deleted file mode 100644 (file)
index 438355c..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Foundation/Foundation.h>
-
-@interface WebDatabase : NSObject 
-{
-    NSString *path;
-    unsigned count;
-    BOOL isOpen;
-    unsigned sizeLimit;
-    unsigned usage;
-}
-
-- (void)setObject:(id)object forKey:(id)key;
-- (void)removeObjectForKey:(id)key;
-- (void)removeAllObjects;
-- (id)objectForKey:(id)key;
-
-@end
-
-
-@interface WebDatabase (WebDatabaseCreation)
-
-- (id)initWithPath:(NSString *)thePath;
-
-@end
-
-
-@interface WebDatabase (WebDatabaseManagement)
-
-- (void)open;
-- (void)close;
-- (void)sync;
-
-- (NSString *)path;
-- (BOOL)isOpen;
-
-- (unsigned)count;
-- (unsigned)sizeLimit;
-- (void)setSizeLimit:(unsigned)limit;
-- (unsigned)usage;
-
-@end
diff --git a/WebKit/Misc/WebDatabase.m b/WebKit/Misc/WebDatabase.m
deleted file mode 100644 (file)
index de3d73a..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <WebKit/WebDatabase.h>
-#import <JavaScriptCore/Assertions.h>
-
-// implementation WebDatabase ------------------------------------------------------------------------
-
-@implementation WebDatabase
-
--(void)setObject:(id)object forKey:(id)key
-{
-    ASSERT_NOT_REACHED();
-}
-
--(void)removeObjectForKey:(id)key
-{
-    ASSERT_NOT_REACHED();
-}
-
--(void)removeAllObjects
-{
-    ASSERT_NOT_REACHED();
-}
-
--(id)objectForKey:(id)key
-{
-    ASSERT_NOT_REACHED();
-    return nil;
-}
-
--(unsigned)count
-{
-    return count;
-}
-
-@end
-
-
-// implementation WebDatabase (WebDatabaseCreation) --------------------------------------------------------
-
-@implementation WebDatabase (WebDatabaseCreation)
-
--(id)initWithPath:(NSString *)thePath
-{
-    if ((self = [super init])) {
-    
-        path = [[thePath stringByStandardizingPath] copy];
-        isOpen = NO;
-        sizeLimit = 0;
-        usage = 0;
-    
-        return self;
-    }
-    
-    return nil;
-}
-
--(void)dealloc
-{
-    [path release];
-
-    [super dealloc];
-}
-
-@end
-
-
-// implementation WebDatabase (WebDatabaseManagement) ------------------------------------------------------
-
-@implementation WebDatabase (WebDatabaseManagement)
-
--(void)open
-{
-    ASSERT_NOT_REACHED();
-}
-
--(void)close
-{
-    ASSERT_NOT_REACHED();
-}
-
--(void)sync
-{
-    ASSERT_NOT_REACHED();
-}
-
--(NSString *)path
-{
-    return path;
-}
-
--(BOOL)isOpen
-{
-    return isOpen;
-}
-
--(unsigned)count
-{
-    ASSERT_NOT_REACHED();
-    return 0;
-}
-
--(unsigned)sizeLimit
-{
-    return sizeLimit;
-}
-
--(void)setSizeLimit:(unsigned)limit
-{
-    ASSERT_NOT_REACHED();
-}
-
--(unsigned)usage
-{
-    return usage;
-}
-
-@end
index bc732c1461631b0851475ee5bcdb172fb747b439..54d9ee69ef445084e04b62b4a906a4ce869f721f 100644 (file)
 
 #import <Foundation/Foundation.h>
 
-#import "WebDatabase.h"
 
-@interface WebFileDatabase : WebDatabase 
+@interface WebFileDatabase : NSObject
 {
+    NSString *path;
+    unsigned count;
+    BOOL isOpen;
+    unsigned sizeLimit;
+    unsigned usage;
+    
     struct WebLRUFileList *lru;
     NSMutableArray *ops;
     NSMutableDictionary *setCache;
     NSMutableSet *removeCache;
+    
     NSTimer *timer;
     NSTimeInterval touch;
     NSRecursiveLock *mutex;
 }
 
+- (void)setObject:(id)object forKey:(id)key;
+- (void)removeObjectForKey:(id)key;
+- (void)removeAllObjects;
+- (id)objectForKey:(id)key;
+
+- (id)initWithPath:(NSString *)thePath;
+
+- (void)open;
+- (void)close;
+- (void)sync;
+
+- (NSString *)path;
+- (BOOL)isOpen;
+
+- (unsigned)count;
+- (unsigned)sizeLimit;
+- (void)setSizeLimit:(unsigned)limit;
+- (unsigned)usage;
+
 - (void)performSetObject:(id)object forKey:(id)key;
 - (void)performRemoveObjectForKey:(id)key;
 
index 6c905acd9ecf7058eaa6f0ce9d641af0c1fe2104..a831b3e616e738a683dd7e00a6ab475891f8a6f4 100644 (file)
@@ -154,7 +154,6 @@ enum
 {
     [key release];
     [object release];
-    
     [super dealloc];
 }
 
@@ -312,12 +311,18 @@ static void databaseInit()
 {
     pthread_once(&databaseInitControl, databaseInit);
 
-    [super initWithPath:thePath];
-    
-    if (self == nil || thePath == nil) {
+    if (!(self = [super init])) 
+        return nil;
+        
+    path = [[thePath stringByStandardizingPath] copy];
+    if (thePath == nil) {
         [self release];
         return nil;
     }
+    
+    isOpen = NO;
+    sizeLimit = 0;
+    usage = 0;
 
     ops = [[NSMutableArray alloc] init];
     setCache = [[NSMutableDictionary alloc] init];
@@ -328,7 +333,12 @@ static void databaseInit()
     return self;
 }
 
-// WebFileDatabase objects are never released, so we need no dealloc implementation.
+-(void)dealloc
+{
+    [path release];
+    [super dealloc];
+}
+
 
 -(void)setTimer
 {
@@ -664,6 +674,21 @@ static void databaseInit()
     LOG(FileDatabaseActivity, "<<< AFTER sync\n%@", WebLRUFileListDescription(lru));
 }
 
+-(NSString *)path
+{
+    return path;
+}
+
+-(BOOL)isOpen
+{
+    return isOpen;
+}
+
+-(unsigned)sizeLimit
+{
+    return sizeLimit;
+}
+
 -(unsigned)count
 {
     if (lru)
@@ -688,4 +713,6 @@ static void databaseInit()
     }
 }
 
+
+
 @end
index f7bb7fab5ede62425120853ae3c7809d59cc291c..f3a5e7186c42f5a55a2a49bfac3565449235027d 100644 (file)
                939810770824BF01008DF038 /* WebDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = 6578F5DE045F817400000128 /* WebDownload.h */; settings = {ATTRIBUTES = (Public, ); }; };
                939810790824BF01008DF038 /* WebLocalizableStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = BEE18F990472B73200CA289C /* WebLocalizableStrings.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9398107A0824BF01008DF038 /* WebKitSystemBits.h in Headers */ = {isa = PBXBuildFile; fileRef = BEE52D4A0473032500CA289C /* WebKitSystemBits.h */; };
-               9398107B0824BF01008DF038 /* WebDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = BE07CEA7047538F000CA289C /* WebDatabase.h */; };
                9398107C0824BF01008DF038 /* WebFileDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = BE07CEA9047538F000CA289C /* WebFileDatabase.h */; };
                9398107D0824BF01008DF038 /* WebLRUFileList.h in Headers */ = {isa = PBXBuildFile; fileRef = BE07CEAB047538F000CA289C /* WebLRUFileList.h */; };
                9398107E0824BF01008DF038 /* WebNSURLExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = BE6DC39904C62C4E004D0EF6 /* WebNSURLExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9398110B0824BF01008DF038 /* WebDownload.m in Sources */ = {isa = PBXBuildFile; fileRef = 6578F5DF045F817400000128 /* WebDownload.m */; };
                9398110D0824BF01008DF038 /* WebLocalizableStrings.m in Sources */ = {isa = PBXBuildFile; fileRef = BEE18F9A0472B73200CA289C /* WebLocalizableStrings.m */; };
                9398110E0824BF01008DF038 /* WebKitSystemBits.m in Sources */ = {isa = PBXBuildFile; fileRef = BEE52D4B0473032500CA289C /* WebKitSystemBits.m */; };
-               9398110F0824BF01008DF038 /* WebDatabase.m in Sources */ = {isa = PBXBuildFile; fileRef = BE07CEA8047538F000CA289C /* WebDatabase.m */; };
                939811100824BF01008DF038 /* WebFileDatabase.m in Sources */ = {isa = PBXBuildFile; fileRef = BE07CEAA047538F000CA289C /* WebFileDatabase.m */; };
                939811110824BF01008DF038 /* WebLRUFileList.m in Sources */ = {isa = PBXBuildFile; fileRef = BE07CEAC047538F000CA289C /* WebLRUFileList.m */; };
                939811120824BF01008DF038 /* WebNSURLExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = BE6DC39A04C62C4E004D0EF6 /* WebNSURLExtras.m */; };
                ED7F6D8B0980683500C235ED /* WebNSDataExtrasPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = ED7F6D8A0980683500C235ED /* WebNSDataExtrasPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 /* End PBXBuildFile section */
 
+/* Begin PBXBuildStyle section */
+               51B0D4750A1BEB2A001760A9 /* Development */ = {
+                       isa = PBXBuildStyle;
+                       buildSettings = {
+                               COPY_PHASE_STRIP = NO;
+                       };
+                       name = Development;
+               };
+               51B0D4760A1BEB2A001760A9 /* Deployment */ = {
+                       isa = PBXBuildStyle;
+                       buildSettings = {
+                               COPY_PHASE_STRIP = YES;
+                       };
+                       name = Deployment;
+               };
+/* End PBXBuildStyle section */
+
 /* Begin PBXFileReference section */
                1C68F640095B5FC100C2984E /* webInspector */ = {isa = PBXFileReference; lastKnownFileType = folder; name = webInspector; path = WebInspector/webInspector; sourceTree = SOURCE_ROOT; };
                1C68F65C095B5FC100C2984E /* WebInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebInspector.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebImageRendererFactory.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                9CF0E249021361B00ECA16EA /* WebFramePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFramePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDownloadInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               BE07CEA7047538F000CA289C /* WebDatabase.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabase.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               BE07CEA8047538F000CA289C /* WebDatabase.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebDatabase.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                BE07CEA9047538F000CA289C /* WebFileDatabase.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFileDatabase.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                BE07CEAA047538F000CA289C /* WebFileDatabase.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebFileDatabase.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                BE07CEAB047538F000CA289C /* WebLRUFileList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebLRUFileList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                                F528E3EB031E91AD01CA2ACA /* WebIconDatabasePrivate.h */,
                                F5934C8802E894F50197FBCF /* WebIconLoader.h */,
                                F5934C8902E894F50197FBCF /* WebIconLoader.m */,
-                               BE07CEA7047538F000CA289C /* WebDatabase.h */,
-                               BE07CEA8047538F000CA289C /* WebDatabase.m */,
                                BE07CEA9047538F000CA289C /* WebFileDatabase.h */,
                                BE07CEAA047538F000CA289C /* WebFileDatabase.m */,
                                BE07CEAB047538F000CA289C /* WebLRUFileList.h */,
                                939810770824BF01008DF038 /* WebDownload.h in Headers */,
                                939810790824BF01008DF038 /* WebLocalizableStrings.h in Headers */,
                                9398107A0824BF01008DF038 /* WebKitSystemBits.h in Headers */,
-                               9398107B0824BF01008DF038 /* WebDatabase.h in Headers */,
                                9398107C0824BF01008DF038 /* WebFileDatabase.h in Headers */,
                                9398107D0824BF01008DF038 /* WebLRUFileList.h in Headers */,
                                9398107E0824BF01008DF038 /* WebNSURLExtras.h in Headers */,
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
+                       buildSettings = {
+                       };
+                       buildStyles = (
+                               51B0D4750A1BEB2A001760A9 /* Development */,
+                               51B0D4760A1BEB2A001760A9 /* Deployment */,
+                       );
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                                9398110B0824BF01008DF038 /* WebDownload.m in Sources */,
                                9398110D0824BF01008DF038 /* WebLocalizableStrings.m in Sources */,
                                9398110E0824BF01008DF038 /* WebKitSystemBits.m in Sources */,
-                               9398110F0824BF01008DF038 /* WebDatabase.m in Sources */,
                                939811100824BF01008DF038 /* WebFileDatabase.m in Sources */,
                                939811110824BF01008DF038 /* WebLRUFileList.m in Sources */,
                                939811120824BF01008DF038 /* WebNSURLExtras.m in Sources */,