[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:25:51 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 2fcdf2e83e7eedbbf6991ba4bbafb0ca27e5e2af
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Jul 21 09:11:54 2002 +0000

            More refactoring. Change bridge to get the data source via a
    	method instead of straight from the ivar, and in the method,
    	assert that the data source is not nil and is not
    	provisional. Turns out no one was using it while provisional,
    	which is great. This means we can eliminate the provisional
    	concept from the bridge interface as the next step.
    
    	* WebCoreSupport.subproj/WebBridge.h:
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge dataSource]): New method to get data source - assert
    	it is not nil, and committed.
            (-[WebBridge frame]): Get data source from method.
            (-[WebBridge childFrames]): Likewise.
            (-[WebBridge descendantFrameNamed:]): Likewise.
            (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): Likewise.
            (-[WebBridge openNewWindowWithURL:]): Likewise.
            (-[WebBridge areToolbarsVisible]): Likewise.
            (-[WebBridge setToolbarsVisible:]): Likewise.
            (-[WebBridge areScrollbarsVisible]): Likewise.
            (-[WebBridge setScrollbarsVisible:]): Likewise.
            (-[WebBridge isStatusBarVisible]): Likewise.
            (-[WebBridge setStatusBarVisible:]): Likewise.
            (-[WebBridge setWindowFrame:]): Likewise.
            (-[WebBridge window]): Likewise.
            (-[WebBridge setTitle:]): Likewise.
            (-[WebBridge setStatusText:]): Likewise.
            (-[WebBridge mainFrame]): Likewise.
            (-[WebBridge frameNamed:]): Likewise.
            (-[WebBridge receivedData:withDataSource:]): Likewise.
            (-[WebBridge startLoadingResource:withURL:]): Likewise.
            (-[WebBridge objectLoadedFromCache:size:]): Likewise.
            (-[WebBridge setDataSource:]): Likewise.
            (-[WebBridge openedByScript]): Likewise.
            (-[WebBridge setOpenedByScript:]): Likewise.
            (-[WebBridge setIconURL:]): Likewise.
            (-[WebBridge setIconURL:withType:]): Likewise.
            * WebView.subproj/WebDataSourcePrivate.h,
    	WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSource _isCommitted]): New private method to check if a
    	data source is committed, for the benefit of WebBridge assertions.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1615 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 8dfdc5c..17bbcb1 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,46 @@
+2002-07-21  Maciej Stachowiak  <mjs at apple.com>
+
+        More refactoring. Change bridge to get the data source via a
+	method instead of straight from the ivar, and in the method,
+	assert that the data source is not nil and is not
+	provisional. Turns out no one was using it while provisional,
+	which is great. This means we can eliminate the provisional
+	concept from the bridge interface as the next step.
+
+	* WebCoreSupport.subproj/WebBridge.h:
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge dataSource]): New method to get data source - assert
+	it is not nil, and committed.
+        (-[WebBridge frame]): Get data source from method.
+        (-[WebBridge childFrames]): Likewise.
+        (-[WebBridge descendantFrameNamed:]): Likewise. 
+        (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): Likewise.
+        (-[WebBridge openNewWindowWithURL:]): Likewise.
+        (-[WebBridge areToolbarsVisible]): Likewise.
+        (-[WebBridge setToolbarsVisible:]): Likewise.
+        (-[WebBridge areScrollbarsVisible]): Likewise.
+        (-[WebBridge setScrollbarsVisible:]): Likewise.
+        (-[WebBridge isStatusBarVisible]): Likewise.
+        (-[WebBridge setStatusBarVisible:]): Likewise.
+        (-[WebBridge setWindowFrame:]): Likewise.
+        (-[WebBridge window]): Likewise.
+        (-[WebBridge setTitle:]): Likewise.
+        (-[WebBridge setStatusText:]): Likewise.
+        (-[WebBridge mainFrame]): Likewise.
+        (-[WebBridge frameNamed:]): Likewise.
+        (-[WebBridge receivedData:withDataSource:]): Likewise.
+        (-[WebBridge startLoadingResource:withURL:]): Likewise.
+        (-[WebBridge objectLoadedFromCache:size:]): Likewise.
+        (-[WebBridge setDataSource:]): Likewise.
+        (-[WebBridge openedByScript]): Likewise.
+        (-[WebBridge setOpenedByScript:]): Likewise.
+        (-[WebBridge setIconURL:]): Likewise.
+        (-[WebBridge setIconURL:withType:]): Likewise.
+        * WebView.subproj/WebDataSourcePrivate.h,
+	WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _isCommitted]): New private method to check if a
+	data source is committed, for the benefit of WebBridge assertions.
+
 2002-07-20  Darin Adler  <darin at apple.com>
 
         * WebKit.pbproj/project.pbxproj: Turn stricter warnings back on now that we
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 8dfdc5c..17bbcb1 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,46 @@
+2002-07-21  Maciej Stachowiak  <mjs at apple.com>
+
+        More refactoring. Change bridge to get the data source via a
+	method instead of straight from the ivar, and in the method,
+	assert that the data source is not nil and is not
+	provisional. Turns out no one was using it while provisional,
+	which is great. This means we can eliminate the provisional
+	concept from the bridge interface as the next step.
+
+	* WebCoreSupport.subproj/WebBridge.h:
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge dataSource]): New method to get data source - assert
+	it is not nil, and committed.
+        (-[WebBridge frame]): Get data source from method.
+        (-[WebBridge childFrames]): Likewise.
+        (-[WebBridge descendantFrameNamed:]): Likewise. 
+        (-[WebBridge createChildFrameNamed:withURL:renderPart:allowsScrolling:marginWidth:marginHeight:]): Likewise.
+        (-[WebBridge openNewWindowWithURL:]): Likewise.
+        (-[WebBridge areToolbarsVisible]): Likewise.
+        (-[WebBridge setToolbarsVisible:]): Likewise.
+        (-[WebBridge areScrollbarsVisible]): Likewise.
+        (-[WebBridge setScrollbarsVisible:]): Likewise.
+        (-[WebBridge isStatusBarVisible]): Likewise.
+        (-[WebBridge setStatusBarVisible:]): Likewise.
+        (-[WebBridge setWindowFrame:]): Likewise.
+        (-[WebBridge window]): Likewise.
+        (-[WebBridge setTitle:]): Likewise.
+        (-[WebBridge setStatusText:]): Likewise.
+        (-[WebBridge mainFrame]): Likewise.
+        (-[WebBridge frameNamed:]): Likewise.
+        (-[WebBridge receivedData:withDataSource:]): Likewise.
+        (-[WebBridge startLoadingResource:withURL:]): Likewise.
+        (-[WebBridge objectLoadedFromCache:size:]): Likewise.
+        (-[WebBridge setDataSource:]): Likewise.
+        (-[WebBridge openedByScript]): Likewise.
+        (-[WebBridge setOpenedByScript:]): Likewise.
+        (-[WebBridge setIconURL:]): Likewise.
+        (-[WebBridge setIconURL:withType:]): Likewise.
+        * WebView.subproj/WebDataSourcePrivate.h,
+	WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSource _isCommitted]): New private method to check if a
+	data source is committed, for the benefit of WebBridge assertions.
+
 2002-07-20  Darin Adler  <darin at apple.com>
 
         * WebKit.pbproj/project.pbxproj: Turn stricter warnings back on now that we
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.h b/WebKit/WebCoreSupport.subproj/WebBridge.h
index 69efd29..c58b977 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.h
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.h
@@ -18,5 +18,7 @@
 - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource;
 - (void)setDataSource:(WebDataSource *)ds;
 
+- (WebDataSource *)dataSource;
+
 @end
 
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 7a3fee7..6df10ae 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -41,7 +41,7 @@
 
 - (WebCoreFrameBridge *)frame
 {
-    return [[dataSource webFrame] _frameBridge];
+    return [[[self dataSource] webFrame] _frameBridge];
 }
 
 - (WebCoreBridge *)parent
@@ -52,8 +52,7 @@
 
 - (NSArray *)childFrames
 {
-    WEBKIT_ASSERT(dataSource);
-    NSArray *frames = [dataSource children];
+    NSArray *frames = [[self dataSource] children];
     NSEnumerator *e = [frames objectEnumerator];
     NSMutableArray *frameBridges = [NSMutableArray arrayWithCapacity:[frames count]];
     WebFrame *frame;
@@ -67,20 +66,18 @@
 
 - (WebCoreFrameBridge *)descendantFrameNamed:(NSString *)name
 {
-    WebCoreFrameBridge *provisionalBridge = [[[[dataSource webFrame] provisionalDataSource] frameNamed:name] _frameBridge];
+    WebCoreFrameBridge *provisionalBridge = [[[[[self dataSource] webFrame] provisionalDataSource] frameNamed:name] _frameBridge];
     if (provisionalBridge) {
         return provisionalBridge;
     }
-    return [[[dataSource webFrame] frameNamed:name] _frameBridge];
+    return [[[[self dataSource] webFrame] frameNamed:name] _frameBridge];
 }
 
 - (BOOL)createChildFrameNamed:(NSString *)frameName
     withURL:(NSURL *)URL renderPart:(KHTMLRenderPart *)renderPart
     allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height
 {
-    WEBKIT_ASSERT(dataSource);
-
-    WebFrame *frame = [[dataSource controller] createFrameNamed:frameName for:nil inParent:dataSource allowsScrolling:allowsScrolling];
+    WebFrame *frame = [[[self dataSource] controller] createFrameNamed:frameName for:nil inParent:[self dataSource] allowsScrolling:allowsScrolling];
     if (frame == nil) {
         return NO;
     }
@@ -90,14 +87,14 @@
     [[frame webView] _setMarginWidth:width];
     [[frame webView] _setMarginHeight:height];
 
-    [[frame _frameBridge] loadURL:URL attributes:nil flags:0 withParent:dataSource];
+    [[frame _frameBridge] loadURL:URL attributes:nil flags:0 withParent:[self dataSource]];
     
     return YES;
 }
 
 - (WebCoreBridge *)openNewWindowWithURL:(NSURL *)url
 {
-    WebController *newController = [[[dataSource controller] windowContext] openNewWindowWithURL:url];
+    WebController *newController = [[[[self dataSource] controller] windowContext] openNewWindowWithURL:url];
     WebDataSource *newDataSource;
     
     newDataSource = [[newController mainFrame] provisionalDataSource];
@@ -109,76 +106,74 @@
 
 - (BOOL)areToolbarsVisible
 {
-    return [[[dataSource controller] windowContext] areToolbarsVisible];
+    return [[[[self dataSource] controller] windowContext] areToolbarsVisible];
 }
 
 - (void)setToolbarsVisible:(BOOL)visible
 {
-    [[[dataSource controller] windowContext] setToolbarsVisible:visible];
+    [[[[self dataSource] controller] windowContext] setToolbarsVisible:visible];
 }
 
 - (BOOL)areScrollbarsVisible
 {
-    return [[[dataSource webFrame] webView] allowsScrolling];
+    return [[[[self dataSource] webFrame] webView] allowsScrolling];
 }
 
 - (void)setScrollbarsVisible:(BOOL)visible
 {
-    return [[[dataSource webFrame] webView] setAllowsScrolling:visible];
+    return [[[[self dataSource] webFrame] webView] setAllowsScrolling:visible];
 }
 
 - (BOOL)isStatusBarVisible
 {
-    return [[[dataSource controller] windowContext] isStatusBarVisible];
+    return [[[[self dataSource] controller] windowContext] isStatusBarVisible];
 }
 
 - (void)setStatusBarVisible:(BOOL)visible
 {
-    [[[dataSource controller] windowContext] setStatusBarVisible:visible];
+    [[[[self dataSource] controller] windowContext] setStatusBarVisible:visible];
 }
 
 - (void)setWindowFrame:(NSRect)frame
 {
-    [[[dataSource controller] windowContext] setFrame:frame];
+    [[[[self dataSource] controller] windowContext] setFrame:frame];
 }
 
 - (NSWindow *)window
 {
-    return [[[dataSource controller] windowContext] window];
+    return [[[[self dataSource] controller] windowContext] window];
 }
 
 - (void)setTitle:(NSString *)title
 {
-    WEBKIT_ASSERT(dataSource);
-    [dataSource _setTitle:title];
+    [[self dataSource] _setTitle:title];
 }
 
 - (void)setStatusText:(NSString *)status
 {
-    WEBKIT_ASSERT(dataSource);
-    [[[dataSource controller] windowContext] setStatusText:status];
+    [[[[self dataSource] controller] windowContext] setStatusText:status];
 }
 
 - (WebCoreFrameBridge *)mainFrame
 {
-    return [[[dataSource controller] mainFrame] _frameBridge];
+    return [[[[self dataSource] controller] mainFrame] _frameBridge];
 }
 
 - (WebCoreFrameBridge *)frameNamed:(NSString *)name
 {
-    return [[[dataSource controller] frameNamed:name] _frameBridge];
+    return [[[[self dataSource] controller] frameNamed:name] _frameBridge];
 }
 
 - (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)withDataSource
 {
-    WEBKIT_ASSERT(dataSource != nil);
+    WEBKIT_ASSERT(dataSource == withDataSource);
 
     [self addData:data withEncoding:[dataSource encoding]];
 }
 
 - (WebResourceHandle *)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withURL:(NSURL *)URL
 {
-    return [WebSubresourceClient startLoadingResource:resourceLoader withURL:URL dataSource:dataSource];
+    return [WebSubresourceClient startLoadingResource:resourceLoader withURL:URL dataSource:[self dataSource]];
 }
 
 - (void)objectLoadedFromCache:(NSURL *)URL size:(unsigned)bytes
@@ -188,13 +183,16 @@
     
     handle = [[WebResourceHandle alloc] initWithURL:URL];
     loadProgress = [[WebLoadProgress alloc] initWithBytesSoFar:bytes totalToLoad:bytes];
-    [[dataSource controller] _receivedProgress:loadProgress forResourceHandle:handle fromDataSource: dataSource complete:YES];
+    [[[self dataSource] controller] _receivedProgress:loadProgress forResourceHandle:handle fromDataSource: [self dataSource] complete:YES];
     [loadProgress release];
     [handle release];
 }
 
 - (void)setDataSource: (WebDataSource *)ds
 {
+    WEBKIT_ASSERT(ds != nil);
+    // WEBKIT_ASSERT([ds _isCommitted]);
+
     if (dataSource == nil) {
 	// FIXME: non-retained because data source owns representation owns bridge
 	dataSource = ds;
@@ -208,14 +206,23 @@
 
 }
 
+- (WebDataSource *)dataSource
+{
+    WEBKIT_ASSERT(dataSource != nil);
+    WEBKIT_ASSERT([dataSource _isCommitted]);
+
+    return dataSource;
+}
+
+
 - (BOOL)openedByScript
 {
-    return [[dataSource controller] _openedByScript];
+    return [[[self dataSource] controller] _openedByScript];
 }
 
 - (void)setOpenedByScript:(BOOL)openedByScript
 {
-    [[dataSource controller] _setOpenedByScript:openedByScript];
+    [[[self dataSource] controller] _setOpenedByScript:openedByScript];
 }
 
 - (void)unfocusWindow
@@ -232,12 +239,12 @@
 
 - (void)setIconURL:(NSURL *)url
 {
-    [dataSource _setIconURL:url];
+    [[self dataSource] _setIconURL:url];
 }
 
 - (void)setIconURL:(NSURL *)url withType:(NSString *)type
 {
-    [dataSource _setIconURL:url withType:type];
+    [[self dataSource] _setIconURL:url withType:type];
 }
 
 @end
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index de31c06..aec6088 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -116,6 +116,7 @@
 // This returns nil if the representation is not an WebHTMLRepresentation.
 - (WebBridge *)_bridge;
 
+- (BOOL)_isCommitted;
 - (void)_commitIfReady;
 - (void)_makeRepresentation;
 - (void)_receivedData:(NSData *)data;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 073970a..33672ec 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -448,6 +448,11 @@
     return [representation respondsToSelector:@selector(_bridge)] ? [representation _bridge] : nil;
 }
 
+- (BOOL)_isCommitted
+{
+    return _private->committed;
+}
+
 -(void)_commitIfReady
 {
     if (_private->contentPolicy == WebContentPolicyShow && _private->gotFirstByte && !_private->committed) {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list